Skip to content

Commit

Permalink
Merge pull request #16 from JacobBrownAustin/MAGECLOUD-2521
Browse files Browse the repository at this point in the history
MAGECLOUD-2521: Use TLS 1.2
  • Loading branch information
Joan He authored Aug 9, 2018
2 parents 48ac5e3 + ca78164 commit 4df0182
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
6 changes: 2 additions & 4 deletions library/Zend/Http/Client/Adapter/Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,8 @@ protected function connectHandshake(
// If all is good, switch socket to secure mode. We have to fall back
// through the different modes
$modes = array(
STREAM_CRYPTO_METHOD_TLS_CLIENT,
STREAM_CRYPTO_METHOD_SSLv3_CLIENT,
STREAM_CRYPTO_METHOD_SSLv23_CLIENT,
STREAM_CRYPTO_METHOD_SSLv2_CLIENT
// TODO: Add STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT in the future when it is supported by PHP
STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT
);

$success = false;
Expand Down
3 changes: 2 additions & 1 deletion library/Zend/Mail/Protocol/Imap.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ public function connect($host, $port = null, $ssl = false)

if ($ssl === 'TLS') {
$result = $this->requestAndResponse('STARTTLS');
$result = $result && stream_socket_enable_crypto($this->_socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT);
// TODO: Add STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT in the future when it is supported by PHP
$result = $result && stream_socket_enable_crypto($this->_socket, true, STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT);
if (!$result) {
/**
* @see Zend_Mail_Protocol_Exception
Expand Down
3 changes: 2 additions & 1 deletion library/Zend/Mail/Protocol/Pop3.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ public function connect($host, $port = null, $ssl = false)

if ($ssl === 'TLS') {
$this->request('STLS');
$result = stream_socket_enable_crypto($this->_socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT);
// TODO: Add STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT in the future when it is supported by PHP
$result = stream_socket_enable_crypto($this->_socket, true, STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT);
if (!$result) {
/**
* @see Zend_Mail_Protocol_Exception
Expand Down
3 changes: 2 additions & 1 deletion library/Zend/Mail/Protocol/Smtp.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ public function helo($host = '127.0.0.1')
if ($this->_secure == 'tls') {
$this->_send('STARTTLS');
$this->_expect(220, 180);
if (!stream_socket_enable_crypto($this->_socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) {
// TODO: Add STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT in the future when it is supported by PHP
if (!stream_socket_enable_crypto($this->_socket, true, STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT)) {
/**
* @see Zend_Mail_Protocol_Exception
*/
Expand Down

0 comments on commit 4df0182

Please sign in to comment.