Set default crypto method - Fix #31105

This commit is contained in:
Beno!t POLASZEK 2019-06-04 15:59:49 +02:00
parent 40076b98bf
commit 4f0ad25fab
1 changed files with 3 additions and 0 deletions

View File

@ -140,6 +140,9 @@ final class SocketStream extends AbstractStream
if ($this->streamContextOptions) {
$options = array_merge($options, $this->streamContextOptions);
}
if ($this->isTLS()) {
$options['ssl']['crypto_method'] = $options['ssl']['crypto_method'] ?? STREAM_CRYPTO_METHOD_TLS_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
}
$streamContext = stream_context_create($options);
$this->stream = @stream_socket_client($this->url, $errno, $errstr, $this->timeout, STREAM_CLIENT_CONNECT, $streamContext);
if (false === $this->stream) {