ZF-1004: Add support for stream context in the Socket adapter

Issue Type: Improvement Created: 2007-03-02T07:13:17.000+0000 Last Updated: 2008-01-23T18:42:10.000+0000 Status: Resolved Fix version(s): - 1.0.2 (25/Sep/07)

Reporter: Shahar Evron (shahar) Assignee: Shahar Evron (shahar) Tags: - Zend_Http_Client

Related issues: Attachments: - zend_http_client_sslcert.patch


Currently, the default Socket adapter does not support stream contexts - for example, there is no way to set a local certificate for HTTPS connections (might be important for PayPal access for example)

We should either improve the socket adapter to support this or create a new adapter based on stream_socket_client() instead of fsockopen().


Posted by Shahar Evron (shahar) on 2007-03-02T07:29:14.000+0000

apparently, stream_context_set_params() can be used on sockets created by fsockopen as well - so there is not much rewriting to be done here. This can be done using a new configuration option and a call to stream_context_set_params() on the socket after opening the connection.

Posted by Alex Adriaanse (alexadriaanse) on 2007-07-30T21:37:39.000+0000

I have attached a patch that changes the Socket adapter to use stream_context_create() instead of fsockopen(), and adds 'sslcert' and 'sslpassphrase' options to allow client SSL certificates to be used. Although the conversion from fsockopen() to stream_socket_client() may not have been needed, it only required changes in a few lines of code and as far as I can tell does not have any drawbacks.

Posted by Shahar Evron (shahar) on 2007-07-31T10:38:02.000+0000

Hi Alex,

Thanks for the patch, it looks great! One question: Did you sign your CLA yet? I can only apply the patch if you signed the Framework CLA:…

Posted by Alex Adriaanse (alexadriaanse) on 2007-07-31T10:55:12.000+0000

You're welcome. Yes, I signed the CLA back in November 2006.

Posted by Shahar Evron (shahar) on 2007-08-20T11:28:54.000+0000

Patch applied in revision 6146.

Posted by Shahar Evron (shahar) on 2007-09-16T07:32:06.000+0000

Fixed for both 1.1.0 and 1.0.2

Posted by Wil Sinclair (wil) on 2008-01-23T18:42:10.000+0000

Updating Fix Version to follow issue tracker conventions.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.