cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
New

Openssl Issue?

Is anyone else having issues requesting https resources?

 

I am getting 500 - Internal server error with this script:

<? echo file_get_contents('https://www.google.com'); ?>

This works fine:

 <? echo file_get_contents('http://www.google.com'); ?>

I get the same thing when using CURL:

$ch = curl_init();
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_URL, 'https://www.google.com');
curl_setopt ($ch, CURLOPT_TIMEOUT, 120);
echo curl_exec ($ch);
curl_close ($ch);

Again, http://www.google.com always works.

 

I've had periods where it works, but https requests it mostly fail.

I've caught a verbose response from CURL a few times also:

URL = https://www.google.com 
* Rebuilt URL to: https://www.google.com/ * Trying 172.217.7.196... * TCP_NODELAY set * Connected to www.google.com (172.217.7.196) port 443 (#0) * ALPN, offering http/1.1 * Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH * successfully set certificate verify locations: * CAfile: C:\Program Files (x86)\Parallels\Plesk\Additional\PHPSettings\cacert.pem CApath: none * OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to www.google.com:443 * Closing connection 0

Tech support told me it was my scripting issue, but I would argue a file_get_contents request (wrapped in a try..catch block even) should never cause a 500 error!