2 require_once("../globals.php");
3 require_once("../../library/create_ssl_certificate.php");
5 /********************************************************************************\
6 * Copyright (C) Visolve (vicareplus_engg@visolve.com) *
8 * This program is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU General Public License *
10 * as published by the Free Software Foundation; either version 2 *
11 * of the License, or (at your option) any later version. *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21 ********************************************************************************/
24 * This page is used to setup https access to OpenEMR with client certificate authentication.
25 * If enabled, the browser must connect to OpenEMR using a client SSL certificate that is
26 * generated by OpenEMR. This page is used to create the Certificate Authority and
27 * Apache SSL server certificate.
30 /* This string contains any error messages if generating
35 /* This function is called when the "Save Certificate Settings" button is clicked.
36 * Save the certificate settings to the file globals.php.
37 * The following form inputs are used:
38 * cakey_location - The path to the CA key file
39 * cacrt_location - The path to the CA certificate file
40 * clientCertValidity_hidden - Number of days client certificates are valid.
41 * isClientAuthenticationEnabled - Enable/disable client certificate authentication.
43 * Save these values to the following variables in globals.php:
44 * $certificate_authority_key
45 * $certificate_authority_crt
46 * $client_certificate_valid_in_days
47 * $is_client_ssl_enabled
49 * If an error occurs, set $error_msg to the appropriate string,
50 * which will be displayed later on below.
52 /*function save_certificate_settings() {
53 if($_POST['cakey_location']) { $Authority_key = formData('cakey_location','P',true) ; }
54 if($_POST['cacrt_location']) { $Authority_crt = formData('cacrt_location','P',true); }
55 if($_POST['clientCertValidity_hidden']) { $clientCertValidity = formData('clientCertValidity_hidden','P',true); }
56 if($_POST['isClientAuthenticationEnabled']) { $isClientAuthenticationEnabled = formData('isClientAuthenticationEnabled','P',true); }
58 if ($isClientAuthenticationEnabled == "Yes") {
59 $isClientAuthenticationEnabled = "true";
61 $isClientAuthenticationEnabled = "false";
66 if ($Authority_key != "" && !file_exists($Authority_key)) {
67 $error_msg .= xl('Error: the file does not exist', 'e') . ' ' . $Authority_key . '<br>';
70 if ($Authority_crt != "" && !file_exists($Authority_crt)) {
71 $error_msg .= xl('Error, the file does not exist', 'e') . ' ' . $Authority_crt . '<br>';
74 if ($error_msg != "") {
78 $Authority_key = str_replace('\\\\', '/', $Authority_key);
79 $Authority_key = str_replace('\\', '/', $Authority_key);
80 $Authority_crt = str_replace('\\\\', '/', $Authority_crt);
81 $Authority_crt = str_replace('\\', '/', $Authority_crt);
83 // Read in the globals.php file
84 $globals_file = $GLOBALS['webserver_root'] . "/interface/globals.php";
85 $inputdata = file($globals_file) or die( xl('Could not read file','e')." ". $globals_file);
90 $wrote_enable = false;
91 $wrote_validity = false;
93 // Loop through each line in globals.php, replacing any certificate variables with the new settings.
95 foreach ($inputdata as $line) {
96 if ((strpos($line,"\$certificate_authority_key = \"")) !== false) {
98 $outputdata .= "\$certificate_authority_key = \"$Authority_key\";\n";
100 else if ((strpos($line,"\$certificate_authority_crt = \"")) !== false) {
102 $outputdata .= "\$certificate_authority_crt = \"$Authority_crt\";\n";
104 else if ((strpos($line,"\$is_client_ssl_enabled = ")) !== false) {
105 $wrote_enable = true;
106 $outputdata .= "\$is_client_ssl_enabled = $isClientAuthenticationEnabled;\n";
108 else if ((strpos($line,"\$client_certificate_valid_in_days = \"")) !== false) {
109 $wrote_validity = true;
110 $outputdata .= "\$client_certificate_valid_in_days = \"$clientCertValidity\";\n";
113 $outputdata .= $line;
116 if ($wrote_key === false || $wrote_crt === false ||
117 $wrote_enable === false || $wrote_validity === false) {
119 $outputdata .= "<?php\n";
121 if ($wrote_key === false) {
122 $outputdata .= "\$certificate_authority_key = \"$Authority_key\";\n";
124 if ($wrote_crt == false) {
125 $outputdata .= "\$certificate_authority_crt = \"$Authority_crt\";\n";
127 if ($wrote_enable === false) {
128 $outputdata .= "\$is_client_ssl_enabled = $isClientAuthenticationEnabled;\n";
130 if ($wrote_validity === false) {
131 $outputdata .= "\$client_certificate_valid_in_days = \"$clientCertValidity\";\n";
133 $outputdata .= "\n?>\n";
136 // Write the modified globals.php back to disk
137 $fd = @fopen($globals_file, 'w');
139 $error_msg .= xl('Error, unable to open file', 'e') . ' ' . $globals_file;
142 fwrite($fd, $outputdata);
145 $GLOBALS['is_client_ssl_enabled'] = ($isClientAuthenticationEnabled == "true");
146 $GLOBALS['certificate_authority_crt'] = $Authority_crt;
147 $GLOBALS['certificate_authority_key'] = $Authority_key;
152 * Send an http reply so that the browser downloads the given file.
153 * Delete the file once the download is completed.
154 * @param $filename - The file to download.
155 * @param $filetype - The type of file.
157 function download_file($filename, $filetype) {
159 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
160 header("Cache-Control: private");
161 header("Content-Type: application/" . $filetype);
162 header("Content-Disposition: attachment; filename=" . basename($filename) . ";");
163 header("Content-Transfer-Encoding: binary");
164 header("Content-Length: " . filesize($filename));
171 /* This function is called when the "Create Client Certificate" button is clicked.
172 * Create and download a client certificate, given the following form inputs:
173 * client_cert_user - The username to store in the certificate
174 * client_cert_email - The email to store in the certificate
175 * A temporary certificate will be written to /tmp/openemr_client_cert.p12.
176 * If an error occurs, set the $error_msg (which is displayed later below).
178 function create_client_cert() {
181 if (!$GLOBALS['is_client_ssl_enabled']) {
182 $error_msg .= xl('Error, User Certificate Authentication is not enabled in OpenEMR', 'e');
186 if ($_POST["client_cert_user"]) { $user = formData('client_cert_user','P',true); }
187 if ($_POST["client_cert_email"]) { $email = formData('client_cert_email','P',true); }
188 $opensslconf = $GLOBALS['webserver_root'] . "/library/openssl.cnf";
190 $data = create_user_certificate($user, $email, $serial,
191 $GLOBALS['certificate_authority_crt'],
192 $GLOBALS['certificate_authority_key'],
193 $GLOBALS['client_certificate_valid_in_days']);
194 if ($data === false) {
195 $error_msg .= xl('Error, unable to create client certificate.', 'e');
199 $filename = $GLOBALS['temporary_files_dir'] . "/openemr_client_cert.p12";
200 $handle = fopen($filename, 'wt');
201 fwrite($handle, $data);
204 download_file($filename, "p12");
207 /* Delete the following temporary certificate files, if they exist:
208 * /tmp/CertificateAuthority.key
209 * /tmp/CertificateAuthority.crt
215 function delete_certificates() {
216 $tempDir = $GLOBALS['temporary_files_dir'];
217 $files = array("CertificateAuthority.key", "CertificateAuthority.crt",
218 "Server.key", "Server.crt", "admin.p12", "ssl.zip");
220 foreach ($files as $file) {
221 if (file_exists($file)) {
228 * Create and download the following certificates:
229 * - CertificateAuthority.key
230 * - CertificateAuthority.crt
234 * The following form inputs are used:
236 function create_and_download_certificates()
239 $tempDir = $GLOBALS['temporary_files_dir'];
241 $zipName = $tempDir . "/ssl.zip";
242 if (file_exists($zipName)) {
246 /* Retrieve the certificate name settings from the form input */
247 if ($_POST["commonName"]) { $commonName = formData('commonName','P',true); }
248 if ($_POST["emailAddress"]) { $emailAddress = formData('emailAddress','P',true); }
249 if ($_POST["countryName"]) { $countryName = formData('countryName','P',true); }
250 if ($_POST["stateOrProvinceName"]) { $stateOrProvinceName = formData('stateOrProvinceName','P',true); }
251 if ($_POST["localityName"]) { $localityName = formData('localityName','P',true); }
252 if ($_POST["organizationName"]) { $organizationName = formData('organizationName','P',true); }
253 if ($_POST["organizationalUnitName"]) { $organizationName = formData('organizationalUnitName','P',true); }
254 if ($_POST["clientCertValidity"]) { $clientCertValidity = formData('clientCertValidity','P',true); }
257 /* Create the Certficate Authority (CA) */
258 $arr = create_csr("OpenEMR CA for " . $commonName, $emailAddress, $countryName, $stateOrProvinceName,$localityName, $organizationName, $organizationalUnitName);
260 if ($arr === false) {
261 $error_msg .= xl('Error, unable to create the Certificate Authority certificate.', 'e');
262 delete_certificates();
267 $ca_crt = create_crt($ca_key, $ca_csr, NULL, $ca_key);
268 if ($ca_crt === false) {
269 $error_msg .= xl('Error, unable to create the Certificate Authority certificate.', 'e');
270 delete_certificates();
273 openssl_pkey_export_to_file($ca_key, $tempDir . "/CertificateAuthority.key");
274 openssl_x509_export_to_file($ca_crt, $tempDir . "/CertificateAuthority.crt");
276 /* Create the Server certificate */
277 $arr = create_csr($commonName, $emailAddress, $countryName, $stateOrProvinceName,
278 $localityName, $organizationName, $organizationalUnitName);
279 if ($arr === false) {
280 $error_msg .= xl('Error, unable to create the Server certificate.', 'e');
281 delete_certificates();
285 $server_csr = $arr[0];
286 $server_key = $arr[1];
287 $server_crt = create_crt($server_key, $server_csr, $ca_crt, $ca_key);
289 if (server_crt
=== false) {
290 $error_msg .= xl('Error, unable to create the Server certificate.', 'e');
291 delete_certificates();
295 openssl_pkey_export_to_file($server_key, $tempDir . "/Server.key");
296 openssl_x509_export_to_file($server_crt, $tempDir . "/Server.crt");
298 /* Create the client certificate for the 'admin' user */
300 $res = sqlStatement("select id from users where username='admin'");
301 if ($row = sqlFetchArray($res)) {
302 $serial = $row['id'];
305 $user_cert = create_user_certificate("admin", $emailAddress, $serial,
306 $tempDir . "/CertificateAuthority.crt",
307 $tempDir . "/CertificateAuthority.key",
308 $clientCertValidity);
309 if ($user_cert === false) {
310 $error_msg .= xl('Error, unable to create the admin.p12 certificate.', 'e');
311 delete_certificates();
314 $adminFile = $tempDir . "/admin.p12";
315 $handle = fopen($adminFile, 'w');
316 fwrite($handle, $user_cert);
319 /* Create a zip file containing the CertificateAuthority, Server, and admin files */
321 if (! (class_exists('ZipArchive')) ) {
322 $_SESSION["zip_error"]="Error, Class ZipArchive does not exist";
326 $zip = new ZipArchive
;
328 $_SESSION["zip_error"]="Error, Could not create file archive";
332 if ($zip->open($zipName, ZIPARCHIVE
::CREATE
)) {
333 $files = array("CertificateAuthority.key", "CertificateAuthority.crt",
334 "Server.key", "Server.crt", "admin.p12");
335 foreach ($files as $file) {
336 $zip->addFile($tempDir . "/" . $file, $file);
340 $_SESSION["zip_error"]="Error, unable to create zip file with all the certificates";
345 if(ini_get('zlib.output_compression')) {
346 ini_set('zlib.output_compression', 'Off');
349 catch (Exception
$e) {
350 $_SESSION["zip_error"]="Error, Could not create file archive";
354 download_file($zipName, "zip");
359 if (!acl_check('admin', 'users')) {
363 /*if ($_POST["mode"] == "save_ssl_settings") {
364 save_certificate_settings();
367 if ($_POST["mode"] == "create_client_certificate") {
368 create_client_cert();
370 else if ($_POST["mode"] == "download_certificates") {
371 create_and_download_certificates();
378 <script language
="Javascript">
381 /* If Enable User Certificate Authentication is set to "Yes", check the following:
382 * - The Client certificate validation period is > 0
383 * - The CertificateAuthority.key path is not empty
384 * - The CertificateAuthority.crt path is not empty
386 /*function save_click() {
387 if (document.ssl_frm.isClientAuthenticationEnabled[0].checked) {
388 if(document.ssl_certificate_frm.clientCertValidity.value > 0) {
389 document.ssl_frm.clientCertValidity_hidden.value = document.ssl_certificate_frm.clientCertValidity.value;
392 alert("<?php xl('Client certificate validity should be a valid number.', 'e'); ?>");
393 document.ssl_certificate_frm.clientCertValidity.focus();
396 if (document.ssl_frm.cakey_location.value == "") {
397 alert ("<?php xl('Certificate Authority key file location cannot be empty', 'e'); ?>");
398 document.ssl_frm.cakey_location.focus();
402 if (document.ssl_frm.cacrt_location.value == "") {
403 alert ("<?php xl('Certificate Authority crt file location cannot be empty', 'e'); ?>");
404 document.ssl_frm.cacrt_location.focus();
411 //check whether email id is valid or not
412 function checkEmail(email
) {
416 var lat
=str
.indexOf(at
);
418 var ldot
=str
.indexOf(dot
);
419 if (str
.indexOf(at
)==-1){
423 if (str
.indexOf(at
)==-1 || str
.indexOf(at
)==0 || str
.indexOf(at
)==lstr
){
427 if (str
.indexOf(dot
)==-1 || str
.indexOf(dot
)==0 || str
.indexOf(dot
)==lstr
){
431 if (str
.indexOf(at
,(lat+
1))!=-1){
435 if (str
.substring(lat
-1,lat
)==dot || str
.substring(lat+
1,lat+
2)==dot
){
439 if (str
.indexOf(dot
,(lat+
2))==-1){
443 if (str
.indexOf(" ")!=-1){
449 function download_click(){
450 if (document
.ssl_certificate_frm
.commonName
.value
== "") {
451 alert ("<?php xl('Host Name cannot be empty', 'e'); ?>");
452 document
.ssl_certificate_frm
.commonName
.focus();
456 if (document
.ssl_certificate_frm
.emailAddress
.value
) {
457 //call checkEmail function
458 if(checkEmail(document
.ssl_certificate_frm
.emailAddress
.value
) == false){
459 alert ("<?php xl('Provide valid Email Address', 'e'); ?>");
464 if (document
.ssl_certificate_frm
.countryName
.value
.length
> 2) {
465 alert ("<?php xl('Country Name should be represent in two letters. (Example: United States is US)', 'e'); ?>");
466 document
.ssl_certificate_frm
.countryName
.focus();
469 if (document
.ssl_certificate_frm
.clientCertValidity
.value
< 1) {
470 alert ("<?php xl('Client certificate validity should be a valid number.', 'e'); ?>");
471 document
.ssl_certificate_frm
.clientCertValidity
.focus();
475 function create_client_certificate_click(){
477 /*if(document.ssl_frm.isClientAuthenticationEnabled[1].checked == true)
479 alert ("<?php xl('User Certificate Authentication is disabled', 'e'); ?>");
483 if (document
.client_cert_frm
.client_cert_user
.value
== "") {
484 alert ("<?php xl('User name or Host name cannot be empty', 'e'); ?>");
485 document
.ssl_certificate_frm
.commonName
.focus();
488 if (document
.client_cert_frm
.client_cert_email
.value
) {
489 //call checkEmail function
490 if(checkEmail(document
.client_cert_frm
.client_cert_email
.value
) == false){
491 alert ("<?php xl('Provide valid Email Address', 'e'); ?>");
497 function isNumberKey(evt
) {
498 var charCode
= (evt
.which
) ? evt
.which
: evt
.keyCode
499 if (charCode
> 31 && (charCode
< 48 || charCode
> 57))
507 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
508 <style type
="text/css">
518 <body
class="body_top">
519 <span
class='title'><b
><?php
xl('SSL Certificate Administration', 'e'); ?
></b
></span
>
521 <?php
if($_SESSION["zip_error"]) { ?
>
522 <div
> <table align
="center" >
523 <tr valign
="top"> <td rowspan
="3"> <?php
echo "<font class='redtext'>" . xl($_SESSION["zip_error"]) ?
> </td
> </tr
>
525 unset($_SESSION["zip_error"]); ?
></div
>
529 if ($error_msg != "") {
530 echo "<font class='redtext'>" . $error_msg . "</font><br><br>";
533 <?php
xl('To setup https access with client certificate authentication, do the following', 'e'); ?
>
535 <li
><?php
xl('Create the SSL Certificate Authority and Server certificates.', 'e'); ?
>
536 <li
><?php
xl('Configure Apache to use HTTPS.', 'e'); ?
>
537 <li
><?php
xl('Configure Apache and OpenEMR to use Client side SSL certificates.', 'e'); ?
>
538 <li
><?php
xl('Import certificate to the browser.', 'e'); ?
>
539 <li
><?php
xl('Create a Client side SSL certificate for each user or client machine.', 'e'); ?
>
543 if ($GLOBALS['certificate_authority_crt'] != "" && $GLOBALS['is_client_ssl_enabled']) {
544 xl('OpenEMR already has a Certificate Authority configured.', 'e');
547 <form method
='post' name
=ssl_certificate_frm action
='ssl_certificates_admin.php'>
548 <input type
='hidden' name
='mode' value
='download_certificates'>
549 <div
class='borderbox'>
550 <b
><?php
xl('Create the SSL Certificate Authority and Server certificates.', 'e'); ?
></b
><br
>
552 1. <?php
xl('Fill in the values below', 'e'); ?
><br
>
553 2. <?php
xl('Click Download Certificate to download the certificates in the file ssl.zip', 'e'); ?
> <br
>
554 3. <?php
xl('Extract the zip file', 'e'); echo ": ssl.zip "; ?
><br
></br
>
555 <?php
xl('The zip file will contain the following items', 'e'); ?
> <br
>
557 <li
>Server
.crt
: <?php
xl('The Apache SSL server certificate and public key', 'e'); ?
>
558 <li
>Server
.key
: <?php
xl('The corresponding private key', 'e'); ?
>
559 <li
>CertificateAuthority
.crt
: <?php
xl('The Certificate Authority certificate', 'e'); ?
>
560 <li
>CertificateAuthority
.key
: <?php
xl('The corresponding private key', 'e'); ?
>
561 <li
>admin
.p12
: <?php
xl('A client certificate for the admin user', 'e'); ?
>
565 <td
><?php
xl('Host Name', 'e'); ?
> *:</td
>
566 <td
><input name
='commonName' type
='text' value
=''></td
>
567 <td
><?php
xl('Example', 'e') ; echo ': hostname.domain.com'; ?
></td
>
570 <td
><?php
xl('Email Address', 'e'); ?
>:</td
>
571 <td
><input name
='emailAddress' type
='text' value
=''></td
>
572 <td
><?php
xl('Example', 'e') ; echo ': web_admin@domain.com'; ?
></td
>
575 <td
><?php
xl('Organization Name', 'e'); ?
>:</td
>
576 <td
><input name
='organizationName' type
='text' value
=''></td
>
577 <td
><?php
xl('Example', 'e'); echo ': My Company Ltd'; ?
></td
>
580 <td
><?php
xl('Organizational Unit Name', 'e'); ?
>:</td
>
581 <td
><input name
='organizationalUnitName' type
='text' value
=''></td
>
582 <td
><?php
xl('Example', 'e'); echo ': OpenEMR'; ?
></td
>
585 <td
><?php
xl('Locality', 'e'); ?
>:</td
>
586 <td
><input name
='localityName' type
='text' value
=''></td
>
587 <td
><?php
xl('Example', 'e') ; echo ': City'; ?
></td
>
590 <td
><?php
xl('State Or Province', 'e'); ?
>:</td
>
591 <td
><input name
='stateOrProvinceName' type
='text' value
=''></td
>
592 <td
><?php
xl('Example', 'e') ; echo ': California'; ?
></td
>
595 <td
><?php
xl('Country', 'e'); ?
>:</td
>
596 <td
><input name
='countryName' type
='text' value
='' maxlength
='2'></td
>
597 <td
><?php
xl('Example', 'e'); echo ': US'; echo ' ('; xl('Should be two letters', 'e'); echo ')'; ?
></td
>
600 <td
><?php
xl('Client certificate validation period', 'e'); ?
>:</td
>
601 <td
><input name
='clientCertValidity' type
='text' onkeypress
='return isNumberKey(event)' value
='365'></td
>
602 <td
><?php
xl('days', 'e'); ?
></td
>
605 <td colspan
=3 align
='center'>
606 <input name
='sslcrt' type
='submit' onclick
='return download_click();' value
='<?php xl('Download Certificates
', 'e
'); ?>'>
614 <div
class="borderbox">
615 <b
><?php
xl('Configure Apache to use HTTPS.', 'e'); ?
></b
><br
>
617 <?php
xl('Add new certificates to the Apache configuration file', 'e'); ?
>:<br
>
620 SSLCertificateFile
/path
/to
/Server
.crt
<br
>
621 SSLCertificateKeyFile
/path
/to
/Server
.key
<br
>
622 SSLCACertificateFile
/path
/to
/CertificateAuthority
.crt
<br
>
624 <?php
xl('Note','e'); ?
>:
626 <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
>
627 <li
> <?php
xl('To Disable HTTPS, comment the above lines in Apache configuration file and restart Apache server.', 'e'); ?
>
632 <div
class="borderbox">
633 <form name
='ssl_frm' method
='post'>
634 <b
><?php
xl('Configure Apache to use Client side SSL certificates', 'e'); ?
> </b
>
636 <?php
xl('Add following lines to the Apache configuration file', 'e'); ?
>:<br
>
638 SSLVerifyClient
require<br
>
640 SSLOptions +StdEnvVars
<br
>
641 <!--/br
> <b
><?php
xl('Configure Openemr to use Client side SSL certificates', 'e'); ?
> </b
></br
>
642 <input type
='hidden' name
='clientCertValidity_hidden' value
=''>
643 <input type
='hidden' name
='mode' value
='save_ssl_settings'></br
>
644 <table cellpadding
=0 cellspacing
=0>
646 <td
><?php
xl('Enable User Certificate Authentication', 'e'); ?
>:</td
>
648 <input name
='isClientAuthenticationEnabled' type
='radio' value
='Yes'
649 <?php
if ($GLOBALS['is_client_ssl_enabled']) echo "checked"; ?
> > <?php
xl('Yes', 'e'); ?
>
650 <input name
='isClientAuthenticationEnabled' type
='radio' value
='No' <?php
if (!$GLOBALS['is_client_ssl_enabled']) echo "checked"; ?
> > <?php
xl('No', 'e'); ?
>
653 <tr
><td
> 
;</td
></tr
>
655 <td
>CertificateAuthority
.key
<?php
xl('file location', 'e'); ?
>: </td
>
657 <input type
='hidden' name
='hiden_cakey' />
658 <input name
='cakey_location' type
='text' size
=20 value
='<?php echo $GLOBALS['certificate_authority_key
'] ?>' /> (<?php
xl('Provide absolute path', 'e'); ?
>)
662 <td
>CertificateAuthority
.crt
<?php
xl('file location', 'e'); ?
>: </td
>
664 <input type
='hidden' name
='hiden_cacrt' />
665 <input name
='cacrt_location' type
=text size
=20 value
='<?php echo $GLOBALS['certificate_authority_crt
'] ?>'/> (<?php
xl('Provide absolute path', 'e'); ?
>)
670 <input type
='submit' value
='<?php xl('Save Certificate Settings
', 'e
'); ?>' onclick
='return save_click();'-->
671 </br
> <b
><?php
xl('Configure Openemr to use Client side SSL certificates', 'e'); ?
> </b
></br
>
672 <input type
='hidden' name
='clientCertValidity_hidden' value
=''>
675 <?php
xl('Update the following variables in file', 'e'); ?
>: globals
.php
</br
></br
>
676 <?php
xl('To enable Client side ssl certificates', 'e'); ?
></br
>
677 <?php
xl('Set', 'e'); ?
> 'is_client_ssl_enabled' <?php
xl('to', 'e'); ?
> 'true' </br
></br
>
678 <?php
xl('Provide absolute path of file', 'e'); ?
> CertificateAuthority
.key
</br
>
679 <?php
xl('Set', 'e'); ?
> 'certificate_authority_key' <?php
xl('to absolute path of file', 'e'); ?
> 'CertificateAuthority.key'</br
></br
>
680 <?php
xl('Provide absolute path of file', 'e'); ?
> CertificateAuthority
.crt
</br
>
681 <?php
xl('Set', 'e'); ?
> 'certificate_authority_crt' <?php
xl('to absolute path of file', 'e'); ?
> 'CertificateAuthority.crt'</br
>
683 </br
><?php
xl('Note','e'); ?
>:
685 <li
><?php
xl('To Enable Client side SSL certificates authentication, HTTPS should be enabled.', 'e'); ?
>
686 <li
><?php
xl('After performing above configurations, import the admin client certificate to the browser and restart Apache server (empty password).', 'e'); ?
>
687 <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'); ?
>
691 <div
class="borderbox">
692 <b
><?php
xl('Create Client side SSL certificates', 'e'); ?
></b
><br
>
694 <?php
xl('Create a client side SSL certificate for either a user or a client hostname.', 'e'); ?
>
697 if (!$GLOBALS['is_client_ssl_enabled'] ||
698 $GLOBALS['certificate_authority_crt'] == "") {
699 echo "<font class='redtext'>" . xl('OpenEMR must be configured to use certificates before it can create client certificates.', 'e') . "</font><br>";
702 <form name
='client_cert_frm' method
='post' action
='ssl_certificates_admin.php'>
703 <input type
='hidden' name
='mode' value
='create_client_certificate'>
706 <td
><?php
xl('User or Host name', 'e'); ?
>*:</td
>
707 <td
><input type
='text' name
='client_cert_user' size
=20 />
710 <td
><?php
xl('Email', 'e'); ?
>:</td
>
711 <td
><input type
='text' name
='client_cert_email' size
=20 />
714 </br
> <input type
='submit' onclick
='return create_client_certificate_click();' value
='<?php xl('Create Client Certificate
', 'e
'); ?>'>