#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    3
    Rep Power
    0

    File_get_contents to SSL 3 URL


    Hello. I've tried querying assistance on this but have finally hit a wall and was hoping someone with actual experience in PHP and SSL might be able to point me in the right direction.

    I have XAMPP 1.8.1 running on my developer box to test out PHP, and I am running the following code:

    PHP Code:
    <?php     echo file_get_contents('https://localserver.domain.org'); ?>
    In php.ini I have
    Code:
    extension=php_openssl.dll
    uncommented.
    When I run the above code, I get the following error:

    Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
    After speaking with the system admin in charge of localserver, I found out that localserver will only accept SSL 3.0 connections, and OpenSSL appears to be running SSL23 (from what I understand of the above error message). Is there someway to get OpenSSL to use SSL 3 to make the connection?

    Here is my Apache Version from my phpinfo():
    Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7
    localserver.domain.org is an Oracle Weblogic server.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    3
    Rep Power
    0
    Does anybody have any insight into this problem? Or rather, does anybody have any insight into where I am misinterpreting this problem, if applicable?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    3
    Rep Power
    0
    Okay, I finally found the answer to this, at least by using cURL:

    curl_setopt($curl, CURLOPT_SSLVERSION,3);

    That forces it to use SSL 3, then I just need to get it to accept the certificate.

IMN logo majestic logo threadwatch logo seochat tools logo