cakephp/cakephp — pull request #3706 by MelvinRoss (2014-06-12 15:54:47+00:00)
Title: Add support for specifying protocol in Cakesocket/HttpSocket.  Add HEAD function to HttpSocket

Moved this to point at 2.6 instead of master.

For some reason I can't update my other pull request https://github.com/cakephp/cakephp/pull/3295, so I'll just create another one.

These changes give you the ability to specify the protocol to use when using CakeSocket and HttpSocket. I tried to accommodate as many scenarios as I could think of :
CakeSocket
1.Regular host with protocol param in constructor (host:www.google.com protocol:udp)
2.Host with protocol included in the host string (accommodate anyone with ssl://x.x.x.x as host values in their email.php file)
3.Leaving protocol out defaults to TCP just it always has.

HttpSocket
1.Specifying a protocol in the constructor will override the default of 'ssl' when https url is given. (Get access to working API on badly configured third party server that prevents PHP from detecting the SSL version)
2.Specifying a protocol in the URL itself is not supported and shouldn't be. This is HttpSocket, and we shouldn't be passing it non http urls. ( tls://www.google.com will be ignored and treated as https, and simply use the default ssl://host protocol unless specifically overridden in the constructor. )

Unrelated: Added a HEAD function to HttpSocket to go along with the GET/POST/PATCH/PUT/DELETE functions that are already there. Useful addition if using cake to fetch resources, and you need to know if the remote resource is already present locally without downloading the whole file.