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)
160 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
161 header("Cache-Control: private");
162 header("Content-Type: application/" . $filetype);
163 header("Content-Disposition: attachment; filename=" . basename($filename) . ";");
164 header("Content-Transfer-Encoding: binary");
165 header("Content-Length: " . filesize($filename));
172 /* This function is called when the "Create Client Certificate" button is clicked.
173 * Create and download a client certificate, given the following form inputs:
174 * client_cert_user - The username to store in the certificate
175 * client_cert_email - The email to store in the certificate
176 * A temporary certificate will be written to /tmp/openemr_client_cert.p12.
177 * If an error occurs, set the $error_msg (which is displayed later below).
179 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"]) {
189 $user = formData('client_cert_user', 'P', true);
192 if ($_POST["client_cert_email"]) {
193 $email = formData('client_cert_email', 'P', true);
196 $opensslconf = $GLOBALS['webserver_root'] . "/library/openssl.cnf";
198 $data = create_user_certificate(
202 $GLOBALS['certificate_authority_crt'],
203 $GLOBALS['certificate_authority_key'],
204 $GLOBALS['client_certificate_valid_in_days']
206 if ($data === false) {
207 $error_msg .= xl('Error, unable to create client certificate.', 'e');
211 $filename = $GLOBALS['temporary_files_dir'] . "/openemr_client_cert.p12";
212 $handle = fopen($filename, 'wt');
213 fwrite($handle, $data);
216 download_file($filename, "p12");
219 /* Delete the following temporary certificate files, if they exist:
220 * /tmp/CertificateAuthority.key
221 * /tmp/CertificateAuthority.crt
227 function delete_certificates()
229 $tempDir = $GLOBALS['temporary_files_dir'];
230 $files = array("CertificateAuthority.key", "CertificateAuthority.crt",
231 "Server.key", "Server.crt", "admin.p12", "ssl.zip");
233 foreach ($files as $file) {
234 if (file_exists($file)) {
241 * Create and download the following certificates:
242 * - CertificateAuthority.key
243 * - CertificateAuthority.crt
247 * The following form inputs are used:
249 function create_and_download_certificates()
252 $tempDir = $GLOBALS['temporary_files_dir'];
254 $zipName = $tempDir . "/ssl.zip";
255 if (file_exists($zipName)) {
259 /* Retrieve the certificate name settings from the form input */
260 if ($_POST["commonName"]) {
261 $commonName = formData('commonName', 'P', true);
264 if ($_POST["emailAddress"]) {
265 $emailAddress = formData('emailAddress', 'P', true);
268 if ($_POST["countryName"]) {
269 $countryName = formData('countryName', 'P', true);
272 if ($_POST["stateOrProvinceName"]) {
273 $stateOrProvinceName = formData('stateOrProvinceName', 'P', true);
276 if ($_POST["localityName"]) {
277 $localityName = formData('localityName', 'P', true);
280 if ($_POST["organizationName"]) {
281 $organizationName = formData('organizationName', 'P', true);
284 if ($_POST["organizationalUnitName"]) {
285 $organizationName = formData('organizationalUnitName', 'P', true);
288 if ($_POST["clientCertValidity"]) {
289 $clientCertValidity = formData('clientCertValidity', 'P', true);
293 /* Create the Certficate Authority (CA) */
294 $arr = create_csr("OpenEMR CA for " . $commonName, $emailAddress, $countryName, $stateOrProvinceName, $localityName, $organizationName, $organizationalUnitName);
296 if ($arr === false) {
297 $error_msg .= xl('Error, unable to create the Certificate Authority certificate.', 'e');
298 delete_certificates();
304 $ca_crt = create_crt($ca_key, $ca_csr, null, $ca_key);
305 if ($ca_crt === false) {
306 $error_msg .= xl('Error, unable to create the Certificate Authority certificate.', 'e');
307 delete_certificates();
311 openssl_pkey_export_to_file($ca_key, $tempDir . "/CertificateAuthority.key");
312 openssl_x509_export_to_file($ca_crt, $tempDir . "/CertificateAuthority.crt");
314 /* Create the Server certificate */
319 $stateOrProvinceName,
322 $organizationalUnitName
324 if ($arr === false) {
325 $error_msg .= xl('Error, unable to create the Server certificate.', 'e');
326 delete_certificates();
330 $server_csr = $arr[0];
331 $server_key = $arr[1];
332 $server_crt = create_crt($server_key, $server_csr, $ca_crt, $ca_key);
334 if (server_crt
=== false) {
335 $error_msg .= xl('Error, unable to create the Server certificate.', 'e');
336 delete_certificates();
340 openssl_pkey_export_to_file($server_key, $tempDir . "/Server.key");
341 openssl_x509_export_to_file($server_crt, $tempDir . "/Server.crt");
343 /* Create the client certificate for the 'admin' user */
345 $res = sqlStatement("select id from users where username='admin'");
346 if ($row = sqlFetchArray($res)) {
347 $serial = $row['id'];
350 $user_cert = create_user_certificate(
354 $tempDir . "/CertificateAuthority.crt",
355 $tempDir . "/CertificateAuthority.key",
358 if ($user_cert === false) {
359 $error_msg .= xl('Error, unable to create the admin.p12 certificate.', 'e');
360 delete_certificates();
364 $adminFile = $tempDir . "/admin.p12";
365 $handle = fopen($adminFile, 'w');
366 fwrite($handle, $user_cert);
369 /* Create a zip file containing the CertificateAuthority, Server, and admin files */
371 if (! (class_exists('ZipArchive'))) {
372 $_SESSION["zip_error"]="Error, Class ZipArchive does not exist";
376 $zip = new ZipArchive
;
378 $_SESSION["zip_error"]="Error, Could not create file archive";
382 if ($zip->open($zipName, ZIPARCHIVE
::CREATE
)) {
383 $files = array("CertificateAuthority.key", "CertificateAuthority.crt",
384 "Server.key", "Server.crt", "admin.p12");
385 foreach ($files as $file) {
386 $zip->addFile($tempDir . "/" . $file, $file);
389 $_SESSION["zip_error"]="Error, unable to create zip file with all the certificates";
395 if (ini_get('zlib.output_compression')) {
396 ini_set('zlib.output_compression', 'Off');
398 } catch (Exception
$e) {
399 $_SESSION["zip_error"]="Error, Could not create file archive";
403 download_file($zipName, "zip");
408 if (!acl_check('admin', 'users')) {
412 /*if ($_POST["mode"] == "save_ssl_settings") {
413 save_certificate_settings();
416 if ($_POST["mode"] == "create_client_certificate") {
417 create_client_cert();
418 } else if ($_POST["mode"] == "download_certificates") {
419 create_and_download_certificates();
426 <script language
="Javascript">
429 /* If Enable User Certificate Authentication is set to "Yes", check the following:
430 * - The Client certificate validation period is > 0
431 * - The CertificateAuthority.key path is not empty
432 * - The CertificateAuthority.crt path is not empty
434 /*function save_click() {
435 if (document.ssl_frm.isClientAuthenticationEnabled[0].checked) {
436 if(document.ssl_certificate_frm.clientCertValidity.value > 0) {
437 document.ssl_frm.clientCertValidity_hidden.value = document.ssl_certificate_frm.clientCertValidity.value;
440 alert("<?php xl('Client certificate validity should be a valid number.', 'e'); ?>");
441 document.ssl_certificate_frm.clientCertValidity.focus();
444 if (document.ssl_frm.cakey_location.value == "") {
445 alert ("<?php xl('Certificate Authority key file location cannot be empty', 'e'); ?>");
446 document.ssl_frm.cakey_location.focus();
450 if (document.ssl_frm.cacrt_location.value == "") {
451 alert ("<?php xl('Certificate Authority crt file location cannot be empty', 'e'); ?>");
452 document.ssl_frm.cacrt_location.focus();
459 //check whether email id is valid or not
460 function checkEmail(email
) {
464 var lat
=str
.indexOf(at
);
466 var ldot
=str
.indexOf(dot
);
467 if (str
.indexOf(at
)==-1){
471 if (str
.indexOf(at
)==-1 || str
.indexOf(at
)==0 || str
.indexOf(at
)==lstr
){
475 if (str
.indexOf(dot
)==-1 || str
.indexOf(dot
)==0 || str
.indexOf(dot
)==lstr
){
479 if (str
.indexOf(at
,(lat+
1))!=-1){
483 if (str
.substring(lat
-1,lat
)==dot || str
.substring(lat+
1,lat+
2)==dot
){
487 if (str
.indexOf(dot
,(lat+
2))==-1){
491 if (str
.indexOf(" ")!=-1){
497 function download_click(){
498 if (document
.ssl_certificate_frm
.commonName
.value
== "") {
499 alert ("<?php xl('Host Name cannot be empty', 'e'); ?>");
500 document
.ssl_certificate_frm
.commonName
.focus();
504 if (document
.ssl_certificate_frm
.emailAddress
.value
) {
505 //call checkEmail function
506 if(checkEmail(document
.ssl_certificate_frm
.emailAddress
.value
) == false){
507 alert ("<?php xl('Provide valid Email Address', 'e'); ?>");
512 if (document
.ssl_certificate_frm
.countryName
.value
.length
> 2) {
513 alert ("<?php xl('Country Name should be represent in two letters. (Example: United States is US)', 'e'); ?>");
514 document
.ssl_certificate_frm
.countryName
.focus();
517 if (document
.ssl_certificate_frm
.clientCertValidity
.value
< 1) {
518 alert ("<?php xl('Client certificate validity should be a valid number.', 'e'); ?>");
519 document
.ssl_certificate_frm
.clientCertValidity
.focus();
523 function create_client_certificate_click(){
525 /*if(document.ssl_frm.isClientAuthenticationEnabled[1].checked == true)
527 alert ("<?php xl('User Certificate Authentication is disabled', 'e'); ?>");
531 if (document
.client_cert_frm
.client_cert_user
.value
== "") {
532 alert ("<?php xl('User name or Host name cannot be empty', 'e'); ?>");
533 document
.ssl_certificate_frm
.commonName
.focus();
536 if (document
.client_cert_frm
.client_cert_email
.value
) {
537 //call checkEmail function
538 if(checkEmail(document
.client_cert_frm
.client_cert_email
.value
) == false){
539 alert ("<?php xl('Provide valid Email Address', 'e'); ?>");
545 function isNumberKey(evt
) {
546 var charCode
= (evt
.which
) ? evt
.which
: evt
.keyCode
547 if (charCode
> 31 && (charCode
< 48 || charCode
> 57))
555 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
556 <style type
="text/css">
566 <body
class="body_top">
567 <span
class='title'><b
><?php
xl('SSL Certificate Administration', 'e'); ?
></b
></span
>
569 <?php
if ($_SESSION["zip_error"]) { ?
>
570 <div
> <table align
="center" >
571 <tr valign
="top"> <td rowspan
="3"> <?php
echo "<font class='redtext'>" . xl($_SESSION["zip_error"]) ?
> </td
> </tr
>
573 unset($_SESSION["zip_error"]); ?
></div
>
577 if ($error_msg != "") {
578 echo "<font class='redtext'>" . $error_msg . "</font><br><br>";
581 <?php
xl('To setup https access with client certificate authentication, do the following', 'e'); ?
>
583 <li
><?php
xl('Create the SSL Certificate Authority and Server certificates.', 'e'); ?
>
584 <li
><?php
xl('Configure Apache to use HTTPS.', 'e'); ?
>
585 <li
><?php
xl('Configure Apache and OpenEMR to use Client side SSL certificates.', 'e'); ?
>
586 <li
><?php
xl('Import certificate to the browser.', 'e'); ?
>
587 <li
><?php
xl('Create a Client side SSL certificate for each user or client machine.', 'e'); ?
>
591 if ($GLOBALS['certificate_authority_crt'] != "" && $GLOBALS['is_client_ssl_enabled']) {
592 xl('OpenEMR already has a Certificate Authority configured.', 'e');
595 <form method
='post' name
=ssl_certificate_frm action
='ssl_certificates_admin.php'>
596 <input type
='hidden' name
='mode' value
='download_certificates'>
597 <div
class='borderbox'>
598 <b
><?php
xl('Create the SSL Certificate Authority and Server certificates.', 'e'); ?
></b
><br
>
600 1. <?php
xl('Fill in the values below', 'e'); ?
><br
>
601 2. <?php
xl('Click Download Certificate to download the certificates in the file ssl.zip', 'e'); ?
> <br
>
602 3. <?php
xl('Extract the zip file', 'e');
603 echo ": ssl.zip "; ?
><br
></br
>
604 <?php
xl('The zip file will contain the following items', 'e'); ?
> <br
>
606 <li
>Server
.crt
: <?php
xl('The Apache SSL server certificate and public key', 'e'); ?
>
607 <li
>Server
.key
: <?php
xl('The corresponding private key', 'e'); ?
>
608 <li
>CertificateAuthority
.crt
: <?php
xl('The Certificate Authority certificate', 'e'); ?
>
609 <li
>CertificateAuthority
.key
: <?php
xl('The corresponding private key', 'e'); ?
>
610 <li
>admin
.p12
: <?php
xl('A client certificate for the admin user', 'e'); ?
>
614 <td
><?php
xl('Host Name', 'e'); ?
> *:</td
>
615 <td
><input name
='commonName' type
='text' value
=''></td
>
616 <td
><?php
xl('Example', 'e') ;
617 echo ': hostname.domain.com'; ?
></td
>
620 <td
><?php
xl('Email Address', 'e'); ?
>:</td
>
621 <td
><input name
='emailAddress' type
='text' value
=''></td
>
622 <td
><?php
xl('Example', 'e') ;
623 echo ': web_admin@domain.com'; ?
></td
>
626 <td
><?php
xl('Organization Name', 'e'); ?
>:</td
>
627 <td
><input name
='organizationName' type
='text' value
=''></td
>
628 <td
><?php
xl('Example', 'e');
629 echo ': My Company Ltd'; ?
></td
>
632 <td
><?php
xl('Organizational Unit Name', 'e'); ?
>:</td
>
633 <td
><input name
='organizationalUnitName' type
='text' value
=''></td
>
634 <td
><?php
xl('Example', 'e');
635 echo ': OpenEMR'; ?
></td
>
638 <td
><?php
xl('Locality', 'e'); ?
>:</td
>
639 <td
><input name
='localityName' type
='text' value
=''></td
>
640 <td
><?php
xl('Example', 'e') ;
641 echo ': City'; ?
></td
>
644 <td
><?php
xl('State Or Province', 'e'); ?
>:</td
>
645 <td
><input name
='stateOrProvinceName' type
='text' value
=''></td
>
646 <td
><?php
xl('Example', 'e') ;
647 echo ': California'; ?
></td
>
650 <td
><?php
xl('Country', 'e'); ?
>:</td
>
651 <td
><input name
='countryName' type
='text' value
='' maxlength
='2'></td
>
652 <td
><?php
xl('Example', 'e');
655 xl('Should be two letters', 'e');
659 <td
><?php
xl('Client certificate validation period', 'e'); ?
>:</td
>
660 <td
><input name
='clientCertValidity' type
='text' onkeypress
='return isNumberKey(event)' value
='365'></td
>
661 <td
><?php
xl('days', 'e'); ?
></td
>
664 <td colspan
=3 align
='center'>
665 <input name
='sslcrt' type
='submit' onclick
='return download_click();' value
='<?php xl('Download Certificates
', 'e
'); ?>'>
673 <div
class="borderbox">
674 <b
><?php
xl('Configure Apache to use HTTPS.', 'e'); ?
></b
><br
>
676 <?php
xl('Add new certificates to the Apache configuration file', 'e'); ?
>:<br
>
679 SSLCertificateFile
/path
/to
/Server
.crt
<br
>
680 SSLCertificateKeyFile
/path
/to
/Server
.key
<br
>
681 SSLCACertificateFile
/path
/to
/CertificateAuthority
.crt
<br
>
683 <?php
xl('Note', 'e'); ?
>:
685 <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
>
686 <li
> <?php
xl('To Disable HTTPS, comment the above lines in Apache configuration file and restart Apache server.', 'e'); ?
>
691 <div
class="borderbox">
692 <form name
='ssl_frm' method
='post'>
693 <b
><?php
xl('Configure Apache to use Client side SSL certificates', 'e'); ?
> </b
>
695 <?php
xl('Add following lines to the Apache configuration file', 'e'); ?
>:<br
>
697 SSLVerifyClient
require<br
>
699 SSLOptions +StdEnvVars
<br
>
700 <!--/br
> <b
><?php
xl('Configure Openemr to use Client side SSL certificates', 'e'); ?
> </b
></br
>
701 <input type
='hidden' name
='clientCertValidity_hidden' value
=''>
702 <input type
='hidden' name
='mode' value
='save_ssl_settings'></br
>
703 <table cellpadding
=0 cellspacing
=0>
705 <td
><?php
xl('Enable User Certificate Authentication', 'e'); ?
>:</td
>
707 <input name
='isClientAuthenticationEnabled' type
='radio' value
='Yes'
708 <?php
if ($GLOBALS['is_client_ssl_enabled']) {
710 } ?
> > <?php
xl('Yes', 'e'); ?
>
711 <input name
='isClientAuthenticationEnabled' type
='radio' value
='No' <?php
if (!$GLOBALS['is_client_ssl_enabled']) {
713 } ?
> > <?php
xl('No', 'e'); ?
>
716 <tr
><td
> 
;</td
></tr
>
718 <td
>CertificateAuthority
.key
<?php
xl('file location', 'e'); ?
>: </td
>
720 <input type
='hidden' name
='hiden_cakey' />
721 <input name
='cakey_location' type
='text' size
=20 value
='<?php echo $GLOBALS['certificate_authority_key
'] ?>' /> (<?php
xl('Provide absolute path', 'e'); ?
>)
725 <td
>CertificateAuthority
.crt
<?php
xl('file location', 'e'); ?
>: </td
>
727 <input type
='hidden' name
='hiden_cacrt' />
728 <input name
='cacrt_location' type
=text size
=20 value
='<?php echo $GLOBALS['certificate_authority_crt
'] ?>'/> (<?php
xl('Provide absolute path', 'e'); ?
>)
733 <input type
='submit' value
='<?php xl('Save Certificate Settings
', 'e
'); ?>' onclick
='return save_click();'-->
734 </br
> <b
><?php
xl('Configure Openemr to use Client side SSL certificates', 'e'); ?
> </b
></br
>
735 <input type
='hidden' name
='clientCertValidity_hidden' value
=''>
738 <?php
xl('Update the following variables in file', 'e'); ?
>: globals
.php
</br
></br
>
739 <?php
xl('To enable Client side ssl certificates', 'e'); ?
></br
>
740 <?php
xl('Set', 'e'); ?
> 'is_client_ssl_enabled' <?php
xl('to', 'e'); ?
> 'true' </br
></br
>
741 <?php
xl('Provide absolute path of file', 'e'); ?
> CertificateAuthority
.key
</br
>
742 <?php
xl('Set', 'e'); ?
> 'certificate_authority_key' <?php
xl('to absolute path of file', 'e'); ?
> 'CertificateAuthority.key'</br
></br
>
743 <?php
xl('Provide absolute path of file', 'e'); ?
> CertificateAuthority
.crt
</br
>
744 <?php
xl('Set', 'e'); ?
> 'certificate_authority_crt' <?php
xl('to absolute path of file', 'e'); ?
> 'CertificateAuthority.crt'</br
>
746 </br
><?php
xl('Note', 'e'); ?
>:
748 <li
><?php
xl('To Enable Client side SSL certificates authentication, HTTPS should be enabled.', 'e'); ?
>
749 <li
><?php
xl('After performing above configurations, import the admin client certificate to the browser and restart Apache server (empty password).', 'e'); ?
>
750 <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'); ?
>
754 <div
class="borderbox">
755 <b
><?php
xl('Create Client side SSL certificates', 'e'); ?
></b
><br
>
757 <?php
xl('Create a client side SSL certificate for either a user or a client hostname.', 'e'); ?
>
760 if (!$GLOBALS['is_client_ssl_enabled'] ||
761 $GLOBALS['certificate_authority_crt'] == "") {
762 echo "<font class='redtext'>" . xl('OpenEMR must be configured to use certificates before it can create client certificates.', 'e') . "</font><br>";
765 <form name
='client_cert_frm' method
='post' action
='ssl_certificates_admin.php'>
766 <input type
='hidden' name
='mode' value
='create_client_certificate'>
769 <td
><?php
xl('User or Host name', 'e'); ?
>*:</td
>
770 <td
><input type
='text' name
='client_cert_user' size
=20 />
773 <td
><?php
xl('Email', 'e'); ?
>:</td
>
774 <td
><input type
='text' name
='client_cert_email' size
=20 />
777 </br
> <input type
='submit' onclick
='return create_client_certificate_click();' value
='<?php xl('Create Client Certificate
', 'e
'); ?>'>