File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 5555 SSLCertificateFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='ssl_domain'>.crt
5656 SSLCertificateKeyFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='ssl_domain'>.key
5757<tmpl_if name='has_bundle_cert'>
58- SSLCACertificateFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='ssl_domain'>.bundle
58+ <tmpl_if name='apache_version' op='<' value='2.4.8' format='version'>
59+ SSLCertificateChainFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='ssl_domain'>.bundle
60+ </tmpl_if>
5961</tmpl_if>
6062</tmpl_if>
6163 </IfModule>
Original file line number Diff line number Diff line change @@ -335,8 +335,15 @@ function ssl($event_name, $data) {
335335
336336 //* Write new ssl files
337337 if (trim ($ data ["new " ]["ssl_request " ]) != '' ) $ app ->system ->file_put_contents ($ csr_file , $ data ["new " ]["ssl_request " ]);
338- if (trim ($ data ["new " ]["ssl_cert " ]) != '' ) $ app ->system ->file_put_contents ($ crt_file , $ data ["new " ]["ssl_cert " ]);
339- if (trim ($ data ["new " ]["ssl_bundle " ]) != '' ) $ app ->system ->file_put_contents ($ bundle_file , $ data ["new " ]["ssl_bundle " ]);
338+ if (version_compare ($ app ->system ->getapacheversion (true ), '2.4.8 ' , '>= ' )) {
339+ $ tmp_data = '' ;
340+ if (trim ($ data ["new " ]["ssl_cert " ]) != '' ) $ tmp_data .= $ data ["new " ]["ssl_cert " ] . "\n" ;
341+ if (trim ($ data ["new " ]["ssl_bundle " ]) != '' ) $ tmp_data .= $ data ["new " ]["ssl_bundle " ];
342+ if (trim ($ tmp_data ) != '' ) $ app ->system ->file_put_contents ($ crt_file , $ tmp_data );
343+ } else {
344+ if (trim ($ data ["new " ]["ssl_cert " ]) != '' ) $ app ->system ->file_put_contents ($ crt_file , $ data ["new " ]["ssl_cert " ]);
345+ if (trim ($ data ["new " ]["ssl_bundle " ]) != '' ) $ app ->system ->file_put_contents ($ bundle_file , $ data ["new " ]["ssl_bundle " ]);
346+ }
340347
341348 //* Write the key file, if field is empty then import the key into the db
342349 if (trim ($ data ["new " ]["ssl_key " ]) != '' ) {
You can’t perform that action at this time.
0 commit comments