Added option to set the TLS protocol versions to be used in webservers
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -30,6 +30,20 @@ return array(
|
||||
'save_method' => 'storeSettingField',
|
||||
'overview_option' => true
|
||||
),
|
||||
'system_ssl_protocols' => array(
|
||||
'label' => $lng['serversettings']['ssl']['ssl_protocols'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ssl_protocols',
|
||||
'type' => 'option',
|
||||
'default' => 'TLSv1,TLSv1.2',
|
||||
'option_mode' => 'multiple',
|
||||
'option_options' => array(
|
||||
'TLSv1' => 'TLSv1',
|
||||
'TLSv1.1' => 'TLSv1.1',
|
||||
'TLSv1.2' => 'TLSv1.2'
|
||||
),
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_ssl_cipher_list' => array(
|
||||
'label' => $lng['serversettings']['ssl']['ssl_cipher_list'],
|
||||
'settinggroup' => 'system',
|
||||
@@ -87,8 +101,7 @@ return array(
|
||||
'string_type' => 'string',
|
||||
'string_emptyallowed' => false,
|
||||
'default' => 'shmcb:/var/run/apache2/ocsp-stapling.cache(131072)',
|
||||
'visible' => Settings::Get('system.webserver') == "apache2" &&
|
||||
Settings::Get('system.apache24') == 1,
|
||||
'visible' => Settings::Get('system.webserver') == "apache2" && Settings::Get('system.apache24') == 1,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_leenabled' => array(
|
||||
@@ -120,7 +133,7 @@ return array(
|
||||
'type' => 'string',
|
||||
'string_type' => 'file',
|
||||
'default' => '/etc/apache2/conf-enabled/acme.conf',
|
||||
'save_method' => 'storeSettingField',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_letsencryptca' => array(
|
||||
'label' => $lng['serversettings']['letsencryptca'],
|
||||
@@ -130,8 +143,8 @@ return array(
|
||||
'default' => 'testing',
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array(
|
||||
'testing' => 'https://acme-staging'.(Settings::Get('system.leapiversion') == '2' ? '-v02' : '').'.api.letsencrypt.org (Test)',
|
||||
'production' => 'https://acme-v0'.Settings::Get('system.leapiversion').'.api.letsencrypt.org (Live)'
|
||||
'testing' => 'https://acme-staging' . (Settings::Get('system.leapiversion') == '2' ? '-v02' : '') . '.api.letsencrypt.org (Test)',
|
||||
'production' => 'https://acme-v0' . Settings::Get('system.leapiversion') . '.api.letsencrypt.org (Live)'
|
||||
),
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
|
||||
@@ -557,6 +557,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
||||
('system', 'leregistered', '0'),
|
||||
('system', 'nssextrausers', '0'),
|
||||
('system', 'disable_le_selfcheck', '0'),
|
||||
('system', 'ssl_protocols', 'TLSv1,TLSv1.2'),
|
||||
('panel', 'decimal_places', '4'),
|
||||
('panel', 'adminmail', 'admin@SERVERNAME'),
|
||||
('panel', 'phpmyadmin_url', ''),
|
||||
@@ -589,7 +590,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
||||
('panel', 'password_special_char', '!?<>§$%+#=@'),
|
||||
('panel', 'customer_hide_options', ''),
|
||||
('panel', 'version', '0.9.38.8'),
|
||||
('panel', 'db_version', '201801091');
|
||||
('panel', 'db_version', '201801100');
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `panel_tasks`;
|
||||
|
||||
@@ -3743,3 +3743,12 @@ if (isDatabaseVersion('201801090')) {
|
||||
|
||||
updateToDbVersion('201801091');
|
||||
}
|
||||
|
||||
if (isDatabaseVersion('201801091')) {
|
||||
|
||||
showUpdateStep("Adding new setting for SSL protocols");
|
||||
Settings::AddNew('system.ssl_protocols', 'TLSv1,TLSv1.2');
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToDbVersion('201801100');
|
||||
}
|
||||
|
||||
@@ -2092,3 +2092,5 @@ $lng['serversettings']['leapiversion']['title'] = "Chose Let's Encrypt ACME impl
|
||||
$lng['serversettings']['leapiversion']['description'] = "Chose between ACME v1 and ACME v2 implementation for Let's Encrypt.";
|
||||
$lng['error']['nowildcardwithletsencryptv2'] = 'Let\'s Encrypt can only validate wildcard-domains by DNS with ACME v2, sorry. Please set the ServerAlias to WWW or disable it completely';
|
||||
$lng['admin']['phpsettings']['pass_authorizationheader'] = 'Add "-pass-header Authorization" / "CGIPassAuth On" to vhosts';
|
||||
$lng['serversettings']['ssl']['ssl_protocols']['title'] = 'Configure the TLS protocol version';
|
||||
$lng['serversettings']['ssl']['ssl_protocols']['description'] = 'This is a list of ssl protocols that you want (or don\'t want) to use when using SSL. <b>Notice:</b> Some older browsers may not support the newest protcol versions.<br /><br /><b>Default value is:</b><pre>TLSv1, TLSv1.2</pre>';
|
||||
|
||||
@@ -1743,3 +1743,5 @@ $lng['serversettings']['leapiversion']['title'] = "Wähle Let's Encrypt ACME Imp
|
||||
$lng['serversettings']['leapiversion']['description'] = "Wähle zwischen ACME v1 und ACME v2 Implementierung von Let's Encrypt.";
|
||||
$lng['error']['nowildcardwithletsencryptv2'] = 'Let\'s Encrypt kann in ACME v2 Wildcard-Domains nur via DNS validieren, sorry. Bitte den ServerAlias auf WWW setzen oder deaktivieren';
|
||||
$lng['admin']['phpsettings']['pass_authorizationheader'] = 'Füge "-pass-header Authorization" / "CGIPassAuth On" in Vhosts ein';
|
||||
$lng['serversettings']['ssl']['ssl_protocols']['title'] = 'SSL Protokollversion festlegen';
|
||||
$lng['serversettings']['ssl']['ssl_protocols']['description'] = 'Dies ist eine Liste von SSL/TLS Protokollversionen die genutzt werden sollen (oder auch nicht genutzt werden sollen), wenn SSL verwendet wird. <b>Hinweis:</b> Ältere Browser sind möglicherweise nicht vollständig zum neusten Protokoll kompatibel.<br /><br /><b>Standard-Wert ist:</b><pre>TLSv1, TLSv1.2</pre>';
|
||||
|
||||
@@ -454,7 +454,7 @@ class apache extends HttpConfigBase
|
||||
} else {
|
||||
|
||||
$this->virtualhosts_data[$vhosts_filename] .= ' SSLEngine On' . "\n";
|
||||
$this->virtualhosts_data[$vhosts_filename] .= ' SSLProtocol -ALL +TLSv1 +TLSv1.2' . "\n";
|
||||
$this->virtualhosts_data[$vhosts_filename] .= ' SSLProtocol -ALL' . str_replace(","," +", Settings::Get('system.ssl_protocols')) . "\n";
|
||||
if (Settings::Get('system.apache24') == '1') {
|
||||
if (Settings::Get('system.http2_support') == '1') {
|
||||
$this->virtualhosts_data[$vhosts_filename] .= ' Protocols h2 http/1.1' . "\n";
|
||||
@@ -892,7 +892,7 @@ class apache extends HttpConfigBase
|
||||
|
||||
if ($domain['ssl_cert_file'] != '') {
|
||||
$vhost_content .= ' SSLEngine On' . "\n";
|
||||
$vhost_content .= ' SSLProtocol -ALL +TLSv1 +TLSv1.2' . "\n";
|
||||
$vhost_content .= ' SSLProtocol -ALL' . str_replace(","," +", Settings::Get('system.ssl_protocols')) . "\n";
|
||||
if (Settings::Get('system.apache24') == '1') {
|
||||
if (isset($domain['http2']) && $domain['http2'] == '1') {
|
||||
$vhost_content .= ' Protocols h2 http/1.1' . "\n";
|
||||
|
||||
@@ -623,7 +623,7 @@ class nginx extends HttpConfigBase
|
||||
} else {
|
||||
// obsolete: ssl on now belongs to the listen block as 'ssl' at the end
|
||||
// $sslsettings .= "\t" . 'ssl on;' . "\n";
|
||||
$sslsettings .= "\t" . 'ssl_protocols TLSv1 TLSv1.2;' . "\n";
|
||||
$sslsettings .= "\t" . 'ssl_protocols ' . str_replace(",", " ", Settings::Get('system.ssl_protocols')) . ';' . "\n";
|
||||
$sslsettings .= "\t" . 'ssl_ciphers ' . Settings::Get('system.ssl_cipher_list') . ';' . "\n";
|
||||
$sslsettings .= "\t" . 'ssl_ecdh_curve secp384r1;' . "\n";
|
||||
$sslsettings .= "\t" . 'ssl_prefer_server_ciphers on;' . "\n";
|
||||
|
||||
Reference in New Issue
Block a user