I was creating a module application for Zend Framework 2. When I try to send a post request to my server with the necessary details, I get the error "Unable to enable crypto on TCP connection api.mysite.com". Earlier, I was getting the error "Unable to enable crypto on TCP connection api.mysite.com: make sure the "sslcafile" or "sslcapath" option are properly set for the environment."
On googling, I found I should set sslverifypeer to false. After doing this, I was left with the 1st part of the sentence "Unable to enable crypto on TCP connection api.mysite.com." Not getting idea where I could be wrong.
Under previous exceptions, I get "stream_socket_enable_crypto(): this stream does not support SSL/crypto"
Please see this note in the docs: http://framework.zend.com/manual/2.3/en/modules/zend.http.client.html#connecting-to-ssl-urls . You shouldn't set sslverifypeer
unless the site you're connecting to doesn't have a valid SSL certificate. Instead, set sslcapath
as the error suggests. This gives PHP a way of validating the SSL certificate supplied by the host you're connecting to.