I'm having major CURL and Secure SL issues. I have this working in .net, but want it on the apache server side too. The problem is I'm getting NOTHING from SSL sites. I've looked up all the possible solutions. I have a latest and greatest cacert.pem - nothing curl_setopt($ch, CURLOPT_CAINFO, "C:\xampp\htdocs\ad\cacert.pem"); Also, curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); Tried that, I get back encrypted garbage believe it or not. The only way it works is thru Fiddler proxy! And I know that program fakes the certificates. I tried it on another machine and still have the issue. BTW, this is XAMPP, and this is where it has to work. BTW, this issue is with ANY ssl site, nothing specific.
Fixed, Just in case someone has this issue in the future, the headers I was sending were causing issue. I was loading many pages before and I try to match a browser so I don't raise eyebrows. One of the headers from a non ssl page carried over. Do not use "Accept-Encoding: gzip,deflate" with SSL.
I honestly don't know why, but after commenting out that line it worked fine. I also had to set : curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); Code (markup): To make it work. Offensive Header curl_setopt($ch,CURLOPT_HTTPHEADER,array ( "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language: en-us,en;q=0.5", // "Accept-Encoding: gzip,deflate", "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7", "Keep-Alive: 115", "Connection: keep-alive")); Code (markup): On a side note, I did the same complex job in php and dot net. (windows forms) PHP/Curl handles cookies and redirects very nicely though, I can't say the same for .net. I had to do all the redirects and cookie parsing manually. PHP is easier to work with. With a Jquery UI it looks and functions much better than .net, and is portable too. I also switched to netbeans editor and it is much better than npp!
It is not a CURL issue. I reproduced it in .net. I think it has something to do with fiddler and SSL. While Fiddler was running, gzip header was working. When I close fiddler, the .net app crapped out (returned garbage). Took out GZIP and there she goes... I'm going to post to the fiddler board and see what they say....
Thanks for such much details. I used curl in PHP and my own .NET LWP like crawler quite a lot in my daily jobs and I will definitely meet same problems in future.