Reputation: 83
I wrote a script that uses our banks WSDL service, using Nusoap. Requests are signed with certificate. This script works fine on Ubuntu, Apache 2.2, PHP 5.4.
When trying to achieve same thing on Windows 7 (64-bit, Apache 2.2, PHP 5.4), I get this error thrown by Curl:
**SSL read: error:140940E5:SSL routines:SSL3_READ_BYTES:ssl handshake failure, errno 0**
I have disabled firewall and antivirus. I can provide Curl option details, or any other piece of code or info. Thank you!
SOLUTION:
curl_setopt($this->ch, CURLOPT_SSLVERSION, 3);
Upvotes: 4
Views: 4302
Reputation: 527
If you are using nfephp-org lib on an linux based server you may use that code for change ssl protocol:
$nfe = new ToolsNFe(MY_CONFIG_PATH);
$nfe->setSSLProtocol('SSLv3');
When MY_CONFIG_PATH is the path of you configuration file.
Se você está tentando usar o nfephp-org e está com esse erro em servidores linux, mude o protocolo ssl, como no código acima.
Upvotes: 0
Reputation: 27305
To work with a SSL connections you have to enable the php_openssl.dll
in your php.ini
And when you work with curl a common problem is that the openssl module work with a wrong SSL version as default. Most times you should set the SSL version to 3.
curl_setopt($curl, CURLOPT_SSLVERSION,3);
I had the same problem before a few days.
Upvotes: 3