Skip to content

MAGECLOUD-2521: Use TLS 1.2 #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not supporting other old modes, is this approved by PO? Have you run build to make sure this is not causing any problem?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must we really force TLS 1.2 on the client side?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.pcisecuritystandards.org/documents/Migrating_from_SSL_Early_TLS_Information%20Supplement_v1.pdf

The best response is to disable SSL entirely and migrate to a more modern encryption protocol, which at the time of publication is a minimum of TLS v1.1, although entities are strongly encouraged to consider TLS v1.2

@kandy , @piotrekkaminski agreed to TLS 1.2 for Magento 2.3.

As far as client vs server. I skimmed through PCI DSS and that PCI information supplement I've linked to above, and I haven't seen it make a distinction for different versions based on whether or not we are creating the TLS or receiving it. From what I can tell, it seems that PCI wants ALL TLS connects to be either TLS 1.1 or 1.2, but "strongly encourages" 1.2.

I'm not a lawyer, and I've only skimmed through the document, so if I am misinterpreting this, please let me know and we can make corrections.

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