简体   繁体   中英

Unknown SSL protocol error in connection to IP

My code is basically this

$c = curl_init();
curl_setopt($c, CURLOPT_USERPWD, "a:b");
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($c, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
curl_setopt($c, CURLOPT_POSTFIELDS, "{'data': '1'}");
curl_setopt($c, CURLOPT_URL, "https://...");
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_exec($c);

When using VERBOSE this drops out:

* About to connect() to IP port 443 (#46)
* Trying IP...
* Connected to IP (IP) port 443 (#46)
* Unknown SSL protocol error in connection to IP:443 
* Closing connection 46

Usual solutions using google like setting CURLOPT_SSLVERSION to 3 (or any other number) didn't change anything. Any idea what's causing this?

Seems like the problem what trying to send a cURL request through IIS to Apache, not sure why. When I sent it from Apache to Apache it worked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM