Skip to content

Commit 2e21491

Browse files
committed
Continuation of filepaths for customers for ssl.
1 parent 875fef4 commit 2e21491

File tree

4 files changed

+26
-12
lines changed

4 files changed

+26
-12
lines changed

customer_domains.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -742,25 +742,25 @@
742742
// array openssl_x509_parse ( mixed $x509cert [, bool $shortnames = true ] )
743743
// openssl_x509_parse() returns information about the supplied x509cert, including fields such as
744744
// subject name, issuer name, purposes, valid from and valid to dates etc.
745-
$cert_content = openssl_x509_parse($ssl_cert_file);
745+
$cert_content = openssl_x509_parse(Settings::Get('system.ssl_customers_set_paths') == '1' ? file_get_contents($ssl_cert_file) : $ssl_cert_file);
746746

747747
if (is_array($cert_content) && isset($cert_content['subject']) && isset($cert_content['subject']['CN'])) {
748748
// bool openssl_x509_check_private_key ( mixed $cert , mixed $key )
749749
// Checks whether the given key is the private key that corresponds to cert.
750-
if (openssl_x509_check_private_key($ssl_cert_file, $ssl_key_file) === false) {
750+
if (openssl_x509_check_private_key(Settings::Get('system.ssl_customers_set_paths') == '1' ? file_get_contents($ssl_cert_file) : $ssl_cert_file, Settings::Get('system.ssl_customers_set_paths') == '1' ? file_get_contents($ssl_key_file) : $ssl_key_file) === false) {
751751
standard_error('sslcertificateinvalidcertkeypair');
752752
}
753753

754754
// check optional stuff
755755
if ($ssl_ca_file != '') {
756-
$ca_content = openssl_x509_parse($ssl_ca_file);
756+
$ca_content = openssl_x509_parse(Settings::Get('system.ssl_customers_set_paths') == '1' ? file_get_contents($ssl_ca_file) : $ssl_ca_file);
757757
if (!is_array($ca_content)) {
758758
// invalid
759759
standard_error('sslcertificateinvalidca');
760760
}
761761
}
762762
if ($ssl_cert_chainfile != '') {
763-
$chain_content = openssl_x509_parse($ssl_cert_chainfile);
763+
$chain_content = openssl_x509_parse(Settings::Get('system.ssl_customers_set_paths') == '1' ? file_get_contents($ssl_cert_chainfile) : $ssl_cert_chainfile);
764764
if (!is_array($chain_content)) {
765765
// invalid
766766
standard_error('sslcertificateinvalidchain');

lib/formfields/customer/domains/formfield.domain_ssleditor_paths.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,29 @@
2626
'fields' => array(
2727
'ssl_cert_file' => array(
2828
'style' => 'align-top',
29-
'label' => $lng['admin']['ipsandports']['ssl_cert_file_content'],
30-
'desc' => $lng['admin']['ipsandports']['ssl_paste_description'],
29+
'label' => $lng['admin']['ipsandports']['ssl_cert_file_path'],
30+
'desc' => $lng['admin']['ipsandports']['ssl_path_description'],
3131
'type' => 'text',
3232
'value' => $result['ssl_cert_file']
3333
),
3434
'ssl_key_file' => array(
3535
'style' => 'align-top',
36-
'label' => $lng['admin']['ipsandports']['ssl_key_file_content'],
37-
'desc' => $lng['admin']['ipsandports']['ssl_paste_description'],
36+
'label' => $lng['admin']['ipsandports']['ssl_key_file_path'],
37+
'desc' => $lng['admin']['ipsandports']['ssl_path_description'],
3838
'type' => 'text',
3939
'value' => $result['ssl_key_file']
4040
),
4141
'ssl_cert_chainfile' => array(
4242
'style' => 'align-top',
43-
'label' => $lng['admin']['ipsandports']['ssl_cert_chainfile_content'],
44-
'desc' => $lng['admin']['ipsandports']['ssl_paste_description'].$lng['admin']['ipsandports']['ssl_cert_chainfile_content_desc'],
43+
'label' => $lng['admin']['ipsandports']['ssl_cert_chainfile_path'],
44+
'desc' => $lng['admin']['ipsandports']['ssl_path_description'].$lng['admin']['ipsandports']['ssl_cert_chainfile_path_desc'],
4545
'type' => 'text',
4646
'value' => $result['ssl_cert_chainfile']
4747
),
4848
'ssl_ca_file' => array(
4949
'style' => 'align-top',
50-
'label' => $lng['admin']['ipsandports']['ssl_ca_file_content'],
51-
'desc' => $lng['admin']['ipsandports']['ssl_paste_description'].$lng['admin']['ipsandports']['ssl_ca_file_content_desc'],
50+
'label' => $lng['admin']['ipsandports']['ssl_ca_file_path'],
51+
'desc' => $lng['admin']['ipsandports']['ssl_path_description'].$lng['admin']['ipsandports']['ssl_ca_file_path_desc'],
5252
'type' => 'text',
5353
'value' => $result['ssl_ca_file']
5454
)

lng/english.lng.php

+7
Original file line numberDiff line numberDiff line change
@@ -1703,6 +1703,13 @@
17031703
$lng['admin']['ipsandports']['ssl_ca_file_content_desc'] = '<br /><br />Client authentification, set this only if you know what it is.';
17041704
$lng['admin']['ipsandports']['ssl_cert_chainfile_content'] = 'Content of the certificate chainfile (optional)';
17051705
$lng['admin']['ipsandports']['ssl_cert_chainfile_content_desc'] = '<br /><br />Mostly CA_Bundle, or similar, you probably want to set this if you bought a SSL certificate.';
1706+
$lng['admin']['ipsandports']['ssl_path_description'] = 'Specify the complete path to the certificate file in the textbox';
1707+
$lng['admin']['ipsandports']['ssl_cert_file_path'] = 'Path to the ssl certificate';
1708+
$lng['admin']['ipsandports']['ssl_key_file_path'] = 'Path to the ssl (private-) key file';
1709+
$lng['admin']['ipsandports']['ssl_ca_file_path'] = 'Path to the ssl CA file (optional)';
1710+
$lng['admin']['ipsandports']['ssl_ca_file_path_desc'] = '<br /><br />Client authentification, set this only if you know what it is.';
1711+
$lng['admin']['ipsandports']['ssl_cert_chainfile_path'] = 'Path to the certificate chainfile (optional)';
1712+
$lng['admin']['ipsandports']['ssl_cert_chainfile_path_desc'] = '<br /><br />Mostly CA_Bundle, or similar, you probably want to set this if you bought a SSL certificate.';
17061713
$lng['error']['sslcertificateismissingprivatekey'] = 'You need to specify a private key for your certificate';
17071714
$lng['error']['sslcertificatewrongdomain'] = 'The given certificate does not belong to this domain';
17081715
$lng['error']['sslcertificateinvalidcert'] = 'The given certificate-content does not seem to be a valid certificate';

lng/german.lng.php

+7
Original file line numberDiff line numberDiff line change
@@ -1431,6 +1431,13 @@
14311431
$lng['admin']['ipsandports']['ssl_ca_file_content_desc'] = '<br /><br />Client Authentifizierung, dieses Feld sollte nur gesetzt werden, wenn es wirklich gebraucht wird.';
14321432
$lng['admin']['ipsandports']['ssl_cert_chainfile_content'] = 'Inhalt des SSL-CertificateChainFile (optional)';
14331433
$lng['admin']['ipsandports']['ssl_cert_chainfile_content_desc'] = '<br /><br />Meist CA_Bundle, o. Ä. Dies ist das Feld, das gesetzt werden sollte, wenn ein gekauftes SSL-Zertifikat vorliegt.';
1434+
$lng['admin']['ipsandports']['ssl_path_description'] = 'Bitte den Dateipfad zur Zertifikatsdatei in das Textfeld kopieren.';
1435+
$lng['admin']['ipsandports']['ssl_cert_file_content'] = 'Dateipfad zum SSL-Zertifikat (Certificate)';
1436+
$lng['admin']['ipsandports']['ssl_key_file_content'] = 'Dateipfad zur Key-Datei (Private-Key)';
1437+
$lng['admin']['ipsandports']['ssl_ca_file_content'] = 'Dateipfad zur SSL-CA-Datei (optional)';
1438+
$lng['admin']['ipsandports']['ssl_ca_file_content_desc'] = '<br /><br />Client Authentifizierung, dieses Feld sollte nur gesetzt werden, wenn es wirklich gebraucht wird.';
1439+
$lng['admin']['ipsandports']['ssl_cert_chainfile_content'] = 'Dateipfad zum SSL-CertificateChainFile (optional)';
1440+
$lng['admin']['ipsandports']['ssl_cert_chainfile_content_desc'] = '<br /><br />Meist CA_Bundle, o. Ä. Dies ist das Feld, das gesetzt werden sollte, wenn ein gekauftes SSL-Zertifikat vorliegt.';
14341441
$lng['error']['sslcertificateismissingprivatekey'] = 'Für das Zertifikat muss eine Key-Datei (Private-Key) angegeben werden.';
14351442
$lng['error']['sslcertificatewrongdomain'] = 'Das angegebene Zertifikat gilt nicht für die gewählte Domain.';
14361443
$lng['error']['sslcertificateinvalidcert'] = 'Der angegebene Zertifikatsinhalt scheint kein gültiges Zertifikat zu sein.';

0 commit comments

Comments
 (0)