S
S
Sargass2013-08-22 15:34:32
PHP
Sargass, 2013-08-22 15:34:32

php + curl + ssl + tomcat

Good day.
I can’t solve the problem with the answer via https with a php script via curl.
Initially, it was assumed that the exchange would take place over 80ke, just http requests, which was debugged on the test machine.
On the battlefield, it turned out that the executable script that sends me requests is loaded a little further than I thought, and requests come to me via https, from tomcat (like Apache with a Java interpreter, as far as I understand).
Actually, the problem itself is that all certificate checks, and so on, are disabled, but I can’t answer in any way.
The first error I encountered was curl error 35: unknown SSL protocol error in connection .
After that, I set curl setopt, disabling verification of host and user certificates, and began to receivehandshake failure .
I tried manually specifying the ssl version, tried to disable the extra ones in httpd/ssl.conf, absolutely nothing helps.

This is my, almost the first experience with curl, and here such things immediately.
There are some peculiarities in the process of connecting a regular php curl with a tomcat via ssl, apparently?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2013-08-22
@Dimitriys

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

M
Max, 2013-08-22
@AloneCoder

Since everything that was written above did not help, there are still options.
1. Since curl_setopt($ch, CURLOPT_SSLVERSION, 3); try replacing with curl_setopt($ch, CURLOPT_SSLVERSION, 1);
2. I don’t remember why, but once I caught some kind of error for a very long time, the reason for which turned out to be that the OpenSSL libraries for Apache and php were for different versions - as soon as I brought them to one version, everything became ok
3 Rollback OpenSSL to an older version - this also helps in some cases

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question