php - HTTPS and file_get_contents -


i trying read remote website offering json objects using file_get_contents. connection should encrypted try connecting using https.

<?php  $arrcontextoptions=array(     "ssl"=>array(         "cafile" => "api.crt",         "verify_peer"=> true,         "verify_peer_name"=> true     ), );  $context = stream_context_create($arrcontextoptions);  $jsonobjects = file_get_contents('https://example.com', false, $context);  ?> 

however, connection fails following error:

php warning:  file_get_contents(): ssl operation failed code 1. openssl error messages: error:14077458:ssl routines:ssl23_get_server_hello:reason(1112) in api-read.php on line 13 php warning:  file_get_contents(): failed enable crypto in api-read.php on line 13 php warning:  file_get_contents(https://example.com): failed open stream: operation failed in api-read.php on line 13 

the sources found far mentioned different possible causes.

  • using wrong protocol versions. afaik can disallow protocols using cipher option. php should support sslv2, sslv3 , tlsv1.0, correct? verified using curl on command line remote machine accepts connections using sslv3.
  • cn mismatch cn mentioned in certificate ip address connecting to.

so far not solve issue or find helpful information. running out of ideas. suggestions?


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -