-
Notifications
You must be signed in to change notification settings - Fork 24
Add support for stream context options with connectors #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
72b9e76
to
5f2396a
Compare
Now also attempts to normalize the environment for SSL connections as far as possible. |
$contextOpts['ssl'][$this->peerNameCtxKey] = $host; | ||
} | ||
|
||
// Disable TLS compression by default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done automatically in 5.6, but you may not care since you still need to do it pre 5.6.
@rdlowrey The intention is to normalize the behaviour between each of the PHP versions to match the changes you made in 5.6. @DaveRandom Can you trigger another TravisCI build? The re-run button doesn't seem to be an option on PRs. |
5f2396a
to
eafa574
Compare
eafa574
to
0ab2a30
Compare
To summarise what has been discussed in IRC:
|
0ab2a30
to
24c7c83
Compare
What is the state of this PR? I would like to be able to control the socket timeout throught |
+1 Also, isn't it past due date? |
@@ -4,5 +4,5 @@ | |||
|
|||
interface ConnectorInterface | |||
{ | |||
public function create($host, $port); | |||
public function create($host, $port, array $contextOpts = []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the feature, but I'm not sure I like the API.
Let me quote from related ticket #10:
IMO we should first figure out some use cases for this feature to see how this is actually going to be used.
The socket-client component is quite lowlevel, so it's unlikely to be used by many users directly. It's probably more likely going to be used as part of some high level abstractions (say, a Redis or MySQL client implementation). These high level components depend on a
ConnectorInterface
and will likely use DI to inject this. They probably care little about how the connector works. Neither should they care about any "additional" parameters. They do care about the target (hostname and port).
Hence (IMHO) they should not have to take care of context options or connection timeouts.
See also the changes in the SecureConnector
, most implementations of the ConnectorInterface
will likely not care about the concept of "context options" and merely pass these through to their underlying Connector
.
As an alternative, I would suggest passing context options to the constructor of the Connector
.
Any news on this? Just got an issue on one of my packages regarding this PR: WyriHaximus/react-guzzle-psr7#4 |
We're looking into pushing an intermediary release and will hence postpone all tickets related to context options to the next release. See also #45 for an alternative implementation approach. |
Fixes #4