We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e3d41bc commit 35524f6Copy full SHA for 35524f6
src/SecureConnector.php
@@ -27,10 +27,17 @@ public function create($host, $port)
27
28
$context = $this->context + array(
29
'SNI_enabled' => true,
30
- 'SNI_server_name' => $host,
31
'peer_name' => $host
32
);
33
+ // legacy PHP < 5.6 ignores peer_name and requires legacy context options instead
34
+ if (PHP_VERSION_ID < 50600) {
35
+ $context += array(
36
+ 'SNI_server_name' => $host,
37
+ 'CN_match' => $host
38
+ );
39
+ }
40
+
41
return $this->connector->create($host, $port)->then(function (Stream $stream) use ($context) {
42
// (unencrypted) TCP/IP connection succeeded
43
0 commit comments