Skip to content

Commit 6572315

Browse files
committed
Work around HHVM not being able to set context options as an array
1 parent c352b86 commit 6572315

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/SecureConnector.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ public function create($host, $port)
3030
// (unencrypted) TCP/IP connection succeeded
3131

3232
// set required SSL/TLS context options
33-
stream_context_set_option($stream->stream, array('ssl' => $context));
33+
foreach ($context as $name => $value) {
34+
stream_context_set_option($stream->stream, 'ssl', $name, $value);
35+
}
3436

3537
// try to enable encryption
3638
return $this->streamEncryption->enable($stream)->then(null, function ($error) use ($stream) {

0 commit comments

Comments
 (0)