Skip to content

Commit

Permalink
Work around HHVM not being able to set context options as an array
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed Feb 23, 2016
1 parent c352b86 commit 6572315
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/SecureConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ public function create($host, $port)
// (unencrypted) TCP/IP connection succeeded

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

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

0 comments on commit 6572315

Please sign in to comment.