Skip to content

Commit f77cf03

Browse files
committed
fix tls1.3 in nginx
1 parent e0453b9 commit f77cf03

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

server/plugins-available/nginx_plugin.inc.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,10 +1632,11 @@ function update($event_name, $data) {
16321632
$vhost_data['logging'] = $web_config['logging'];
16331633

16341634
// Provide TLS 1.3 support if Nginx version is >= 1.13.0 and when it was linked against OpenSSL(>=1.1.1) at build time and when it was linked against OpenSSL(>=1.1.1) at runtime.
1635-
$nginx_openssl_ver = $app->system->exec_safe('nginx -V 2>&1 | grep OpenSSL | sed \'s/.*built\([a-zA-Z ]*\)OpenSSL \([0-9.]*\).*/\2/\'');
1635+
$nginx_openssl_build_ver = $app->system->exec_safe('nginx -V 2>&1 | grep OpenSSL | sed \'s/.*built\([a-zA-Z ]*\)OpenSSL \([0-9.]*\).*/\2/\'');
1636+
$nginx_openssl_running_ver = $app->system->exec_safe('nginx -V 2>&1 | grep \'running with\' | sed \'s/.*running\([a-zA-Z ]*\)OpenSSL \([0-9.]*\).*/\2/\'');
16361637
if(version_compare($app->system->getnginxversion(true), '1.13.0', '>=')
1637-
&& version_compare($nginx_openssl_ver, '1.1.1', '>=')
1638-
&& version_compare($app->system->getopensslversion(true), '1.1.1', '>=')) {
1638+
&& version_compare($nginx_openssl_build_ver, '1.1.1', '>=')
1639+
&& (empty($nginx_openssl_running_ver) || version_compare($nginx_openssl_running_ver, '1.1.1', '>='))) {
16391640
$app->log('Enable TLS 1.3 for: '.$domain, LOGLEVEL_DEBUG);
16401641
$vhost_data['tls13_supported'] = "y";
16411642
}

0 commit comments

Comments
 (0)