Skip to content

Commit 5f4b3e3

Browse files
committed
Execute the Nginx TLS 1.3 checks only if SSL has been enabled
1 parent de6a88c commit 5f4b3e3

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

server/plugins-available/nginx_plugin.inc.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,14 +1613,15 @@ function update($event_name, $data) {
16131613
$vhost_data['logging'] = $web_config['logging'];
16141614

16151615
// 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.
1616-
$nginx_openssl_build_ver = $app->system->exec_safe('nginx -V 2>&1 | grep \'built with OpenSSL\' | sed \'s/.*built\([a-zA-Z ]*\)OpenSSL \([0-9.]*\).*/\2/\'');
1617-
$nginx_openssl_running_ver = $app->system->exec_safe('nginx -V 2>&1 | grep \'running with OpenSSL\' | sed \'s/.*running\([a-zA-Z ]*\)OpenSSL \([0-9.]*\).*/\2/\'');
1618-
if(version_compare($app->system->getnginxversion(true), '1.13.0', '>=')
1619-
&& version_compare($nginx_openssl_build_ver, '1.1.1', '>=')
1620-
&& (empty($nginx_openssl_running_ver) || version_compare($nginx_openssl_running_ver, '1.1.1', '>='))
1621-
&& $data['new']['ssl'] == 'y') {
1622-
$app->log('Enable TLS 1.3 for: '.$domain, LOGLEVEL_DEBUG);
1623-
$vhost_data['tls13_supported'] = "y";
1616+
if($data['new']['ssl'] == 'y') {
1617+
$nginx_openssl_build_ver = $app->system->exec_safe('nginx -V 2>&1 | grep \'built with OpenSSL\' | sed \'s/.*built\([a-zA-Z ]*\)OpenSSL \([0-9.]*\).*/\2/\'');
1618+
$nginx_openssl_running_ver = $app->system->exec_safe('nginx -V 2>&1 | grep \'running with OpenSSL\' | sed \'s/.*running\([a-zA-Z ]*\)OpenSSL \([0-9.]*\).*/\2/\'');
1619+
if(version_compare($app->system->getnginxversion(true), '1.13.0', '>=')
1620+
&& version_compare($nginx_openssl_build_ver, '1.1.1', '>=')
1621+
&& (empty($nginx_openssl_running_ver) || version_compare($nginx_openssl_running_ver, '1.1.1', '>='))) {
1622+
$app->log('Enable TLS 1.3 for: '.$domain, LOGLEVEL_DEBUG);
1623+
$vhost_data['tls13_supported'] = "y";
1624+
}
16241625
}
16251626

16261627

0 commit comments

Comments
 (0)