zendframework / zend-http

Http component from Zend Framework
BSD 3-Clause "New" or "Revised" License
134 stars 85 forks source link

About the ssltransport option for the Socket client #105

Open mlocati opened 7 years ago

mlocati commented 7 years ago

We currently accept these values for the ssltransport option of the Socket client:

In particular:

There are some problems with the current implementation:

So, what about defining the following transports?

Furthermore, because of security issues, more and more websites disable SSL (both SSLv2 and SSLv3), keeping only TLS connections (see for instance what's doing Google).

So, what about switching from ssl to tls as the default transport?

ezimuel commented 7 years ago

@mlocati this proposal can represent an improvement but it's a big BC break. Especially if we set TLS as default. We should find a different proposal without BC break, to support the new protocols including the options included in PHP 5.6. Let me know if you have any idea on that, thanks!

mlocati commented 7 years ago

We could add new values to $sslCryptoTypes:


protected static $sslCryptoTypes = [
    // Current values (deprecated)
    'ssl'   => STREAM_CRYPTO_METHOD_SSLv23_CLIENT,
    'sslv2' => STREAM_CRYPTO_METHOD_SSLv2_CLIENT,
    'sslv3' => STREAM_CRYPTO_METHOD_SSLv3_CLIENT,
    'tls'   => STREAM_CRYPTO_METHOD_TLS_CLIENT,
    // New values
    'SSL' => 'SSL', // Enable SSL v2 v3
    'SSLv2' => 'SSLv2', // Enable SSL v2 only
    'SSLv3' => 'SSLv3', // Enable SSL v3 only
    'TLS' => 'TLS', // Enable TLS v1.0 and v1.1 and v1.2
    'TLSv1.0' => 'TLSv1.0', // Enable only TLS v1.0 only
    'TLSv1.1' => 'TLSv1.1', // Enable only TLS v1.2 only
    'TLSv1.2' => 'TLSv1.2', // Enable TLS v1.2 only
    '*' => '*', // Enable any kind of connection
];
carnage commented 7 years ago

I'd suggest NOT including any ssl versions in the new values.

mlocati commented 7 years ago

I'd suggest NOT including any ssl versions in the new values.

I'd disagree: we all know that SSL should be avoided, but we can't assume that nobody uses/needs it...

weierophinney commented 4 years ago

This repository has been closed and moved to laminas/laminas-http; a new issue has been opened at https://github.com/laminas/laminas-http/issues/7.