SSL/HTTPS-requests don't work with PHP 5.6 (peer verification)
Status: Beta
Brought to you by:
huni
A user reported that SSL/HTTPS-requests don't work anymore with PHP 5.6.
The reason is that peer-verification is enabled by default since PHP 5.6, and (somehow) the necessary local CA-certificate can't be located in the local environment (only in some environments?).
Anonymous
Same problem here when I tried to crawl this link "https://graph.facebook.com/4/picture?width=378&height=378"
It gave me this error message "Error connecting to https://graph.facebook.com: Host unreachable ()".
I worte something before to solve SSL problem...
I hope it will help you.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
I had the same problem and your solution worked for me. Thanks!
I changed the code of PHPCrawlerHTTPRequest.class.php at line 547 to:
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Last edit: Anonymous 2016-04-01
I am happy for help :)
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Thanks, it worked now for ssl domains
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Hi,
I did not disable verifying peer_name, but as of PHP 5.6 "SNI_server_name" is deprecated and "peer_name" should be used instead (aacording to: http://php.net/manual/en/context.ssl.php ).
I´ve forked the project on github. The following link points to my change, were I set the needed value for SSL via PHP_Version check:
https://github.com/merzilla/phpcrawl/blob/fix-php56-ssl-problem/libs/PHPCrawlerHTTPRequest.class.php#L537
HTH
merzilla
Last edit: Anonymous 2016-02-08
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Thanks merzilla
I can also confirm, that this worked for me (PHP 5.6.x / 7.x).
NetHawk
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Thanks for merzilla. I check your code and it work.