Skip to content
Snippets Groups Projects
Commit 3d4127ad authored by Marius Burkard's avatar Marius Burkard
Browse files

- fix problem with tls version on STARTTLS in mail class

parent b7ee5f0e
No related branches found
No related tags found
No related merge requests found
...@@ -599,10 +599,16 @@ class ispcmail { ...@@ -599,10 +599,16 @@ class ispcmail {
fputs($this->_smtp_conn, 'STARTTLS' . $this->_crlf); fputs($this->_smtp_conn, 'STARTTLS' . $this->_crlf);
fgets($this->_smtp_conn, 515); fgets($this->_smtp_conn, 515);
$crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
}
stream_context_set_option($this->_smtp_conn, 'ssl', 'verify_host', false); stream_context_set_option($this->_smtp_conn, 'ssl', 'verify_host', false);
stream_context_set_option($this->_smtp_conn, 'ssl', 'verify_peer', false); stream_context_set_option($this->_smtp_conn, 'ssl', 'verify_peer', false);
stream_context_set_option($this->_smtp_conn, 'ssl', 'allow_self_signed', true); stream_context_set_option($this->_smtp_conn, 'ssl', 'allow_self_signed', true);
stream_socket_enable_crypto($this->_smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT); stream_socket_enable_crypto($this->_smtp_conn, true, $crypto_method);
} }
//AUTH LOGIN //AUTH LOGIN
......
...@@ -598,7 +598,13 @@ class ispcmail { ...@@ -598,7 +598,13 @@ class ispcmail {
if($this->smtp_crypt == 'tls') { if($this->smtp_crypt == 'tls') {
fputs($this->_smtp_conn, 'STARTTLS' . $this->_crlf); fputs($this->_smtp_conn, 'STARTTLS' . $this->_crlf);
fgets($this->_smtp_conn, 515); fgets($this->_smtp_conn, 515);
stream_socket_enable_crypto($this->_smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT); $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
}
stream_socket_enable_crypto($this->_smtp_conn, true, $crypto_method);
} }
//AUTH LOGIN //AUTH LOGIN
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment