2 require_once("../globals.php");
3 require_once("../../library/create_ssl_certificate.php");
4 require_once("../../library/sql.inc");
5 require_once("$srcdir/translation.inc.php");
7 /********************************************************************************\
8 * Copyright (C) Visolve (vicareplus_engg@visolve.com) *
10 * This program is free software; you can redistribute it and/or *
11 * modify it under the terms of the GNU General Public License *
12 * as published by the Free Software Foundation; either version 2 *
13 * of the License, or (at your option) any later version. *
15 * This program is distributed in the hope that it will be useful, *
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18 * GNU General Public License for more details. *
20 * You should have received a copy of the GNU General Public License *
21 * along with this program; if not, write to the Free Software *
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
23 ********************************************************************************/
26 * This page is used to setup https access to OpenEMR with client certificate authentication.
27 * If enabled, the browser must connect to OpenEMR using a client SSL certificate that is
28 * generated by OpenEMR. This page is used to create the Certificate Authority and
29 * Apache SSL server certificate.
32 /* This string contains any error messages if generating
37 /* This function is called when the "Save Certificate Settings" button is clicked.
38 * Save the certificate settings to the file globals.php.
39 * The following form inputs are used:
40 * cakey_location - The path to the CA key file
41 * cacrt_location - The path to the CA certificate file
42 * clientCertValidity_hidden - Number of days client certificates are valid.
43 * isClientAuthenticationEnabled - Enable/disable client certificate authentication.
45 * Save these values to the following variables in globals.php:
46 * $certificate_authority_key
47 * $certificate_authority_crt
48 * $client_certificate_valid_in_days
49 * $is_client_ssl_enabled
51 * If an error occurs, set $error_msg to the appropriate string,
52 * which will be displayed later on below.
54 /*function save_certificate_settings() {
55 if($_POST['cakey_location']) { $Authority_key = formData('cakey_location','P',true) ; }
56 if($_POST['cacrt_location']) { $Authority_crt = formData('cacrt_location','P',true); }
57 if($_POST['clientCertValidity_hidden']) { $clientCertValidity = formData('clientCertValidity_hidden','P',true); }
58 if($_POST['isClientAuthenticationEnabled']) { $isClientAuthenticationEnabled = formData('isClientAuthenticationEnabled','P',true); }
60 if ($isClientAuthenticationEnabled == "Yes") {
61 $isClientAuthenticationEnabled = "true";
63 $isClientAuthenticationEnabled = "false";
68 if ($Authority_key != "" && !file_exists($Authority_key)) {
69 $error_msg .= xl('Error: the file does not exist', 'e') . ' ' . $Authority_key . '<br>';
72 if ($Authority_crt != "" && !file_exists($Authority_crt)) {
73 $error_msg .= xl('Error, the file does not exist', 'e') . ' ' . $Authority_crt . '<br>';
76 if ($error_msg != "") {
80 $Authority_key = str_replace('\\\\', '/', $Authority_key);
81 $Authority_key = str_replace('\\', '/', $Authority_key);
82 $Authority_crt = str_replace('\\\\', '/', $Authority_crt);
83 $Authority_crt = str_replace('\\', '/', $Authority_crt);
85 // Read in the globals.php file
86 $globals_file = $GLOBALS['webserver_root'] . "/interface/globals.php";
87 $inputdata = file($globals_file) or die( xl('Could not read file','e')." ". $globals_file);
92 $wrote_enable = false;
93 $wrote_validity = false;
95 // Loop through each line in globals.php, replacing any certificate variables with the new settings.
97 foreach ($inputdata as $line) {
98 if ((strpos($line,"\$certificate_authority_key = \"")) !== false) {
100 $outputdata .= "\$certificate_authority_key = \"$Authority_key\";\n";
102 else if ((strpos($line,"\$certificate_authority_crt = \"")) !== false) {
104 $outputdata .= "\$certificate_authority_crt = \"$Authority_crt\";\n";
106 else if ((strpos($line,"\$is_client_ssl_enabled = ")) !== false) {
107 $wrote_enable = true;
108 $outputdata .= "\$is_client_ssl_enabled = $isClientAuthenticationEnabled;\n";
110 else if ((strpos($line,"\$client_certificate_valid_in_days = \"")) !== false) {
111 $wrote_validity = true;
112 $outputdata .= "\$client_certificate_valid_in_days = \"$clientCertValidity\";\n";
115 $outputdata .= $line;
118 if ($wrote_key === false || $wrote_crt === false ||
119 $wrote_enable === false || $wrote_validity === false) {
121 $outputdata .= "<?php\n";
123 if ($wrote_key === false) {
124 $outputdata .= "\$certificate_authority_key = \"$Authority_key\";\n";
126 if ($wrote_crt == false) {
127 $outputdata .= "\$certificate_authority_crt = \"$Authority_crt\";\n";
129 if ($wrote_enable === false) {
130 $outputdata .= "\$is_client_ssl_enabled = $isClientAuthenticationEnabled;\n";
132 if ($wrote_validity === false) {
133 $outputdata .= "\$client_certificate_valid_in_days = \"$clientCertValidity\";\n";
135 $outputdata .= "\n?>\n";
138 // Write the modified globals.php back to disk
139 $fd = @fopen($globals_file, 'w');
141 $error_msg .= xl('Error, unable to open file', 'e') . ' ' . $globals_file;
144 fwrite($fd, $outputdata);
147 $GLOBALS['is_client_ssl_enabled'] = ($isClientAuthenticationEnabled == "true");
148 $GLOBALS['certificate_authority_crt'] = $Authority_crt;
149 $GLOBALS['certificate_authority_key'] = $Authority_key;
154 * Send an http reply so that the browser downloads the given file.
155 * Delete the file once the download is completed.
156 * @param $filename - The file to download.
157 * @param $filetype - The type of file.
159 function download_file($filename, $filetype) {
161 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
162 header("Cache-Control: private");
163 header("Content-Type: application/" . $filetype);
164 header("Content-Disposition: attachment; filename=" . basename($filename) . ";");
165 header("Content-Transfer-Encoding: binary");
166 header("Content-Length: " . filesize($filename));
173 /* This function is called when the "Create Client Certificate" button is clicked.
174 * Create and download a client certificate, given the following form inputs:
175 * client_cert_user - The username to store in the certificate
176 * client_cert_email - The email to store in the certificate
177 * A temporary certificate will be written to /tmp/openemr_client_cert.p12.
178 * If an error occurs, set the $error_msg (which is displayed later below).
180 function create_client_cert() {
183 if (!$GLOBALS['is_client_ssl_enabled']) {
184 $error_msg .= xl('Error, User Certificate Authentication is not enabled in OpenEMR', 'e');
188 if ($_POST["client_cert_user"]) { $user = formData('client_cert_user','P',true); }
189 if ($_POST["client_cert_email"]) { $email = formData('client_cert_email','P',true); }
190 $opensslconf = $GLOBALS['webserver_root'] . "/library/openssl.cnf";
192 $data = create_user_certificate($user, $email, $serial,
193 $GLOBALS['certificate_authority_crt'],
194 $GLOBALS['certificate_authority_key'],
195 $GLOBALS['client_certificate_valid_in_days']);
196 if ($data === false) {
197 $error_msg .= xl('Error, unable to create client certificate.', 'e');
201 $filename = $GLOBALS['temporary_files_dir'] . "/openemr_client_cert.p12";
202 $handle = fopen($filename, 'wt');
203 fwrite($handle, $data);
206 download_file($filename, "p12");
209 /* Delete the following temporary certificate files, if they exist:
210 * /tmp/CertificateAuthority.key
211 * /tmp/CertificateAuthority.crt
217 function delete_certificates() {
218 $tempDir = $GLOBALS['temporary_files_dir'];
219 $files = array("CertificateAuthority.key", "CertificateAuthority.crt",
220 "Server.key", "Server.crt", "admin.p12", "ssl.zip");
222 foreach ($files as $file) {
223 if (file_exists($file)) {
230 * Create and download the following certificates:
231 * - CertificateAuthority.key
232 * - CertificateAuthority.crt
236 * The following form inputs are used:
238 function create_and_download_certificates()
241 $tempDir = $GLOBALS['temporary_files_dir'];
243 $zipName = $tempDir . "/ssl.zip";
244 if (file_exists($zipName)) {
248 /* Retrieve the certificate name settings from the form input */
249 if ($_POST["commonName"]) { $commonName = formData('commonName','P',true); }
250 if ($_POST["emailAddress"]) { $emailAddress = formData('emailAddress','P',true); }
251 if ($_POST["countryName"]) { $countryName = formData('countryName','P',true); }
252 if ($_POST["stateOrProvinceName"]) { $stateOrProvinceName = formData('stateOrProvinceName','P',true); }
253 if ($_POST["localityName"]) { $localityName = formData('localityName','P',true); }
254 if ($_POST["organizationName"]) { $organizationName = formData('organizationName','P',true); }
255 if ($_POST["organizationalUnitName"]) { $organizationName = formData('organizationalUnitName','P',true); }
256 if ($_POST["clientCertValidity"]) { $clientCertValidity = formData('clientCertValidity','P',true); }
259 /* Create the Certficate Authority (CA) */
260 $arr = create_csr("OpenEMR CA for " . $commonName, $emailAddress, $countryName, $stateOrProvinceName,$localityName, $organizationName, $organizationalUnitName);
262 if ($arr === false) {
263 $error_msg .= xl('Error, unable to create the Certificate Authority certificate.', 'e');
264 delete_certificates();
269 $ca_crt = create_crt($ca_key, $ca_csr, NULL, $ca_key);
270 if ($ca_crt === false) {
271 $error_msg .= xl('Error, unable to create the Certificate Authority certificate.', 'e');
272 delete_certificates();
275 openssl_pkey_export_to_file($ca_key, $tempDir . "/CertificateAuthority.key");
276 openssl_x509_export_to_file($ca_crt, $tempDir . "/CertificateAuthority.crt");
278 /* Create the Server certificate */
279 $arr = create_csr($commonName, $emailAddress, $countryName, $stateOrProvinceName,
280 $localityName, $organizationName, $organizationalUnitName);
281 if ($arr === false) {
282 $error_msg .= xl('Error, unable to create the Server certificate.', 'e');
283 delete_certificates();
287 $server_csr = $arr[0];
288 $server_key = $arr[1];
289 $server_crt = create_crt($server_key, $server_csr, $ca_crt, $ca_key);
291 if (server_crt
=== false) {
292 $error_msg .= xl('Error, unable to create the Server certificate.', 'e');
293 delete_certificates();
297 openssl_pkey_export_to_file($server_key, $tempDir . "/Server.key");
298 openssl_x509_export_to_file($server_crt, $tempDir . "/Server.crt");
300 /* Create the client certificate for the 'admin' user */
302 $res = sqlStatement("select id from users where username='admin'");
303 if ($row = sqlFetchArray($res)) {
304 $serial = $row['id'];
307 $user_cert = create_user_certificate("admin", $emailAddress, $serial,
308 $tempDir . "/CertificateAuthority.crt",
309 $tempDir . "/CertificateAuthority.key",
310 $clientCertValidity);
311 if ($user_cert === false) {
312 $error_msg .= xl('Error, unable to create the admin.p12 certificate.', 'e');
313 delete_certificates();
316 $adminFile = $tempDir . "/admin.p12";
317 $handle = fopen($adminFile, 'w');
318 fwrite($handle, $user_cert);
321 /* Create a zip file containing the CertificateAuthority, Server, and admin files */
323 if (! (class_exists('ZipArchive')) ) {
324 $_SESSION["zip_error"]="Error, Class ZipArchive does not exist";
328 $zip = new ZipArchive
;
330 $_SESSION["zip_error"]="Error, Could not create file archive";
334 if ($zip->open($zipName, ZIPARCHIVE
::CREATE
)) {
335 $files = array("CertificateAuthority.key", "CertificateAuthority.crt",
336 "Server.key", "Server.crt", "admin.p12");
337 foreach ($files as $file) {
338 $zip->addFile($tempDir . "/" . $file, $file);
342 $_SESSION["zip_error"]="Error, unable to create zip file with all the certificates";
347 if(ini_get('zlib.output_compression')) {
348 ini_set('zlib.output_compression', 'Off');
351 catch (Exception
$e) {
352 $_SESSION["zip_error"]="Error, Could not create file archive";
356 download_file($zipName, "zip");
361 if (!acl_check('admin', 'users')) {
365 /*if ($_POST["mode"] == "save_ssl_settings") {
366 save_certificate_settings();
369 if ($_POST["mode"] == "create_client_certificate") {
370 create_client_cert();
372 else if ($_POST["mode"] == "download_certificates") {
373 create_and_download_certificates();
380 <script language
="Javascript">
383 /* If Enable User Certificate Authentication is set to "Yes", check the following:
384 * - The Client certificate validation period is > 0
385 * - The CertificateAuthority.key path is not empty
386 * - The CertificateAuthority.crt path is not empty
388 /*function save_click() {
389 if (document.ssl_frm.isClientAuthenticationEnabled[0].checked) {
390 if(document.ssl_certificate_frm.clientCertValidity.value > 0) {
391 document.ssl_frm.clientCertValidity_hidden.value = document.ssl_certificate_frm.clientCertValidity.value;
394 alert("<?php xl('Client certificate validity should be a valid number.', 'e'); ?>");
395 document.ssl_certificate_frm.clientCertValidity.focus();
398 if (document.ssl_frm.cakey_location.value == "") {
399 alert ("<?php xl('Certificate Authority key file location cannot be empty', 'e'); ?>");
400 document.ssl_frm.cakey_location.focus();
404 if (document.ssl_frm.cacrt_location.value == "") {
405 alert ("<?php xl('Certificate Authority crt file location cannot be empty', 'e'); ?>");
406 document.ssl_frm.cacrt_location.focus();
413 //check whether email id is valid or not
414 function checkEmail(email
) {
418 var lat
=str
.indexOf(at
);
420 var ldot
=str
.indexOf(dot
);
421 if (str
.indexOf(at
)==-1){
425 if (str
.indexOf(at
)==-1 || str
.indexOf(at
)==0 || str
.indexOf(at
)==lstr
){
429 if (str
.indexOf(dot
)==-1 || str
.indexOf(dot
)==0 || str
.indexOf(dot
)==lstr
){
433 if (str
.indexOf(at
,(lat+
1))!=-1){
437 if (str
.substring(lat
-1,lat
)==dot || str
.substring(lat+
1,lat+
2)==dot
){
441 if (str
.indexOf(dot
,(lat+
2))==-1){
445 if (str
.indexOf(" ")!=-1){
451 function download_click(){
452 if (document
.ssl_certificate_frm
.commonName
.value
== "") {
453 alert ("<?php xl('Host Name cannot be empty', 'e'); ?>");
454 document
.ssl_certificate_frm
.commonName
.focus();
458 if (document
.ssl_certificate_frm
.emailAddress
.value
) {
459 //call checkEmail function
460 if(checkEmail(document
.ssl_certificate_frm
.emailAddress
.value
) == false){
461 alert ("<?php xl('Provide valid Email Address', 'e'); ?>");
466 if (document
.ssl_certificate_frm
.countryName
.value
.length
> 2) {
467 alert ("<?php xl('Country Name should be represent in two letters. (Example: United States is US)', 'e'); ?>");
468 document
.ssl_certificate_frm
.countryName
.focus();
471 if (document
.ssl_certificate_frm
.clientCertValidity
.value
< 1) {
472 alert ("<?php xl('Client certificate validity should be a valid number.', 'e'); ?>");
473 document
.ssl_certificate_frm
.clientCertValidity
.focus();
477 function create_client_certificate_click(){
479 /*if(document.ssl_frm.isClientAuthenticationEnabled[1].checked == true)
481 alert ("<?php xl('User Certificate Authentication is disabled', 'e'); ?>");
485 if (document
.client_cert_frm
.client_cert_user
.value
== "") {
486 alert ("<?php xl('User name or Host name cannot be empty', 'e'); ?>");
487 document
.ssl_certificate_frm
.commonName
.focus();
490 if (document
.client_cert_frm
.client_cert_email
.value
) {
491 //call checkEmail function
492 if(checkEmail(document
.client_cert_frm
.client_cert_email
.value
) == false){
493 alert ("<?php xl('Provide valid Email Address', 'e'); ?>");
499 function isNumberKey(evt
) {
500 var charCode
= (evt
.which
) ? evt
.which
: evt
.keyCode
501 if (charCode
> 31 && (charCode
< 48 || charCode
> 57))
509 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
510 <style type
="text/css">
520 <body
class="body_top">
521 <span
class='title'><b
><?php
xl('SSL Certificate Administration', 'e'); ?
></b
></span
>
523 <?php
if($_SESSION["zip_error"]) { ?
>
524 <div
> <table align
="center" >
525 <tr valign
="top"> <td rowspan
="3"> <?php
echo "<font class='redtext'>" . xl($_SESSION["zip_error"]) ?
> </td
> </tr
>
527 unset($_SESSION["zip_error"]); ?
></div
>
531 if ($error_msg != "") {
532 echo "<font class='redtext'>" . $error_msg . "</font><br><br>";
535 <?php
xl('To setup https access with client certificate authentication, do the following', 'e'); ?
>
537 <li
><?php
xl('Create the SSL Certificate Authority and Server certificates.', 'e'); ?
>
538 <li
><?php
xl('Configure Apache to use HTTPS.', 'e'); ?
>
539 <li
><?php
xl('Configure Apache and OpenEMR to use Client side SSL certificates.', 'e'); ?
>
540 <li
><?php
xl('Import certificate to the browser.', 'e'); ?
>
541 <li
><?php
xl('Create a Client side SSL certificate for each user or client machine.', 'e'); ?
>
545 if ($GLOBALS['certificate_authority_crt'] != "" && $GLOBALS['is_client_ssl_enabled']) {
546 xl('OpenEMR already has a Certificate Authority configured.', 'e');
549 <form method
='post' name
=ssl_certificate_frm action
='ssl_certificates_admin.php'>
550 <input type
='hidden' name
='mode' value
='download_certificates'>
551 <div
class='borderbox'>
552 <b
><?php
xl('Create the SSL Certificate Authority and Server certificates.', 'e'); ?
></b
><br
>
554 1. <?php
xl('Fill in the values below', 'e'); ?
><br
>
555 2. <?php
xl('Click Download Certificate to download the certificates in the file ssl.zip', 'e'); ?
> <br
>
556 3. <?php
xl('Extract the zip file', 'e'); echo ": ssl.zip "; ?
><br
></br
>
557 <?php
xl('The zip file will contain the following items', 'e'); ?
> <br
>
559 <li
>Server
.crt
: <?php
xl('The Apache SSL server certificate and public key', 'e'); ?
>
560 <li
>Server
.key
: <?php
xl('The corresponding private key', 'e'); ?
>
561 <li
>CertificateAuthority
.crt
: <?php
xl('The Certificate Authority certificate', 'e'); ?
>
562 <li
>CertificateAuthority
.key
: <?php
xl('The corresponding private key', 'e'); ?
>
563 <li
>admin
.p12
: <?php
xl('A client certificate for the admin user', 'e'); ?
>
567 <td
><?php
xl('Host Name', 'e'); ?
> *:</td
>
568 <td
><input name
='commonName' type
='text' value
=''></td
>
569 <td
><?php
xl('Example', 'e') ; echo ': hostname.domain.com'; ?
></td
>
572 <td
><?php
xl('Email Address', 'e'); ?
>:</td
>
573 <td
><input name
='emailAddress' type
='text' value
=''></td
>
574 <td
><?php
xl('Example', 'e') ; echo ': web_admin@domain.com'; ?
></td
>
577 <td
><?php
xl('Organization Name', 'e'); ?
>:</td
>
578 <td
><input name
='organizationName' type
='text' value
=''></td
>
579 <td
><?php
xl('Example', 'e'); echo ': My Company Ltd'; ?
></td
>
582 <td
><?php
xl('Organizational Unit Name', 'e'); ?
>:</td
>
583 <td
><input name
='organizationalUnitName' type
='text' value
=''></td
>
584 <td
><?php
xl('Example', 'e'); echo ': OpenEMR'; ?
></td
>
587 <td
><?php
xl('Locality', 'e'); ?
>:</td
>
588 <td
><input name
='localityName' type
='text' value
=''></td
>
589 <td
><?php
xl('Example', 'e') ; echo ': City'; ?
></td
>
592 <td
><?php
xl('State Or Province', 'e'); ?
>:</td
>
593 <td
><input name
='stateOrProvinceName' type
='text' value
=''></td
>
594 <td
><?php
xl('Example', 'e') ; echo ': California'; ?
></td
>
597 <td
><?php
xl('Country', 'e'); ?
>:</td
>
598 <td
><input name
='countryName' type
='text' value
='' maxlength
='2'></td
>
599 <td
><?php
xl('Example', 'e'); echo ': US'; echo ' ('; xl('Should be two letters', 'e'); echo ')'; ?
></td
>
602 <td
><?php
xl('Client certificate validation period', 'e'); ?
>:</td
>
603 <td
><input name
='clientCertValidity' type
='text' onkeypress
='return isNumberKey(event)' value
='365'></td
>
604 <td
><?php
xl('days', 'e'); ?
></td
>
607 <td colspan
=3 align
='center'>
608 <input name
='sslcrt' type
='submit' onclick
='return download_click();' value
='<?php xl('Download Certificates
', 'e
'); ?>'>
616 <div
class="borderbox">
617 <b
><?php
xl('Configure Apache to use HTTPS.', 'e'); ?
></b
><br
>
619 <?php
xl('Add new certificates to the Apache configuration file', 'e'); ?
>:<br
>
622 SSLCertificateFile
/path
/to
/Server
.crt
<br
>
623 SSLCertificateKeyFile
/path
/to
/Server
.key
<br
>
624 SSLCACertificateFile
/path
/to
/CertificateAuthority
.crt
<br
>
626 <?php
xl('Note','e'); ?
>:
628 <li
><?php
xl('To Enable only HTTPS, perform the above changes and restart Apache server. If you want to configure client side certificates also, please configure them in the next section.', 'e'); ?
></br
>
629 <li
> <?php
xl('To Disable HTTPS, comment the above lines in Apache configuration file and restart Apache server.', 'e'); ?
>
634 <div
class="borderbox">
635 <form name
='ssl_frm' method
='post'>
636 <b
><?php
xl('Configure Apache to use Client side SSL certificates', 'e'); ?
> </b
>
638 <?php
xl('Add following lines to the Apache configuration file', 'e'); ?
>:<br
>
640 SSLVerifyClient
require<br
>
642 SSLOptions +StdEnvVars
<br
>
643 <!--/br
> <b
><?php
xl('Configure Openemr to use Client side SSL certificates', 'e'); ?
> </b
></br
>
644 <input type
='hidden' name
='clientCertValidity_hidden' value
=''>
645 <input type
='hidden' name
='mode' value
='save_ssl_settings'></br
>
646 <table cellpadding
=0 cellspacing
=0>
648 <td
><?php
xl('Enable User Certificate Authentication', 'e'); ?
>:</td
>
650 <input name
='isClientAuthenticationEnabled' type
='radio' value
='Yes'
651 <?php
if ($GLOBALS['is_client_ssl_enabled']) echo "checked"; ?
> > <?php
xl('Yes', 'e'); ?
>
652 <input name
='isClientAuthenticationEnabled' type
='radio' value
='No' <?php
if (!$GLOBALS['is_client_ssl_enabled']) echo "checked"; ?
> > <?php
xl('No', 'e'); ?
>
655 <tr
><td
> 
;</td
></tr
>
657 <td
>CertificateAuthority
.key
<?php
xl('file location', 'e'); ?
>: </td
>
659 <input type
='hidden' name
='hiden_cakey' />
660 <input name
='cakey_location' type
='text' size
=20 value
='<?php echo $GLOBALS['certificate_authority_key
'] ?>' /> (<?php
xl('Provide absolute path', 'e'); ?
>)
664 <td
>CertificateAuthority
.crt
<?php
xl('file location', 'e'); ?
>: </td
>
666 <input type
='hidden' name
='hiden_cacrt' />
667 <input name
='cacrt_location' type
=text size
=20 value
='<?php echo $GLOBALS['certificate_authority_crt
'] ?>'/> (<?php
xl('Provide absolute path', 'e'); ?
>)
672 <input type
='submit' value
='<?php xl('Save Certificate Settings
', 'e
'); ?>' onclick
='return save_click();'-->
673 </br
> <b
><?php
xl('Configure Openemr to use Client side SSL certificates', 'e'); ?
> </b
></br
>
674 <input type
='hidden' name
='clientCertValidity_hidden' value
=''>
677 <?php
xl('Update the following variables in file', 'e'); ?
>: globals
.php
</br
></br
>
678 <?php
xl('To enable Client side ssl certificates', 'e'); ?
></br
>
679 <?php
xl('Set', 'e'); ?
> 'is_client_ssl_enabled' <?php
xl('to', 'e'); ?
> 'true' </br
></br
>
680 <?php
xl('Provide absolute path of file', 'e'); ?
> CertificateAuthority
.key
</br
>
681 <?php
xl('Set', 'e'); ?
> 'certificate_authority_key' <?php
xl('to absolute path of file', 'e'); ?
> 'CertificateAuthority.key'</br
></br
>
682 <?php
xl('Provide absolute path of file', 'e'); ?
> CertificateAuthority
.crt
</br
>
683 <?php
xl('Set', 'e'); ?
> 'certificate_authority_crt' <?php
xl('to absolute path of file', 'e'); ?
> 'CertificateAuthority.crt'</br
>
685 </br
><?php
xl('Note','e'); ?
>:
687 <li
><?php
xl('To Enable Client side SSL certificates authentication, HTTPS should be enabled.', 'e'); ?
>
688 <li
><?php
xl('After performing above configurations, import the admin client certificate to the browser and restart Apache server (empty password).', 'e'); ?
>
689 <li
><?php
xl('To Disable client side SSL certificates, comment above lines in Apache configuration file and set', 'e'); ?
> 'false' <?php
xl('for variable', 'e'); ?
> 'is_client_ssl_enabled' (globals
.php
) <?php
xl('and restart Apache server.', 'e'); ?
>
693 <div
class="borderbox">
694 <b
><?php
xl('Create Client side SSL certificates', 'e'); ?
></b
><br
>
696 <?php
xl('Create a client side SSL certificate for either a user or a client hostname.', 'e'); ?
>
699 if (!$GLOBALS['is_client_ssl_enabled'] ||
700 $GLOBALS['certificate_authority_crt'] == "") {
701 echo "<font class='redtext'>" . xl('OpenEMR must be configured to use certificates before it can create client certificates.', 'e') . "</font><br>";
704 <form name
='client_cert_frm' method
='post' action
='ssl_certificates_admin.php'>
705 <input type
='hidden' name
='mode' value
='create_client_certificate'>
708 <td
><?php
xl('User or Host name', 'e'); ?
>*:</td
>
709 <td
><input type
='text' name
='client_cert_user' size
=20 />
712 <td
><?php
xl('Email', 'e'); ?
>:</td
>
713 <td
><input type
='text' name
='client_cert_email' size
=20 />
716 </br
> <input type
='submit' onclick
='return create_client_certificate_click();' value
='<?php xl('Create Client Certificate
', 'e
'); ?>'>