PHP file_get_contents() SSL operation failed with code 1

Viewed 8176

I'd like to preface this question with "I am an idiot" but I could really use some help.

I have a PHP site hosted by GoDaddy. I have been using file_get_contents() to read a simple XML page for the past several years into the mySQL database for my site. This January I started getting the below warnings.

Warning: file_get_contents() [function.file-get-contents]: SSL operation failed with code 1. OpenSSL Error messages: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure

Warning: file_get_contents() [function.file-get-contents]: Failed to enable crypto

Warning: file_get_contents(https://api.competitionsuite.com/2013-02/Competitions/?o=C35091BF-0F25-4C86-A5AA-C7714E38112C) [function.file-get-contents]: failed to open stream

I did not have an SSL Certificate for the site before this, so I purchased the basic one from GoDaddy hoping this would resolve the error but even on the HTTPS site I get the same errors.

Here is a snippet of my code, but if I need to provide more please let me know.

//read XML
$url = 'https://api.competitionsuite.com/2013-02/Competitions/?o=C35091BF-0F25-4C86-A5AA-C7714E38112C';
$context  = stream_context_create(array('http' => array('header' => 'Accept: application/xml')));
                            
$xml = file_get_contents($url, false, $context);
$xml = simplexml_load_string($xml);

I could really use some guidance if anyone has a spare moment. TIA

0 Answers
Related