Secure connection... looking for help

Last post 02-26-2008 7:57 PM by BarryR. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-26-2008 10:47 AM

    • mmania
    • Top 10 Contributor
    • Joined on 01-20-2008
    • Netherlands
    • Posts 91

    Secure connection... looking for help

    Hi,

    I am a bit lost here about this topic as I know nothing about secure connections and certificates. As suggested in the Restutils.php

     

        // This is to simplify release / distribution but should be changed
        // when you have a production PHP system to be enabled using good
        // certificates.
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

    I googled around but haven't found anything idiot-proof for a guy like me, so if someone has already an idea or knows some good links, please let me know, it will be highly appreciated...

     ciao Luca

     

  • 02-26-2008 7:57 PM In reply to

    • BarryR
    • Top 10 Contributor
    • Joined on 07-20-2007
    • San Diego
    • Posts 602

    Re: Secure connection... looking for help

     Curl requires a certificate to do full verification of the host and peer through https.  Essentially this application was released in this mode which is less secure to work on any system even if that cert is in accessible or not installed on the host..  To specify your certificate and to turn on the validation process you would do something similar to:

    curl_setopt($connection, CURLOPT_SSL_VERIFYPEER, 1);
    curl_setopt($AuthNetConn, CURLOPT_CAINFO, "/path/to/cert/ca-bundle.crt");

    in Windows: 

    curl_setopt($ch, CURLOPT_CAFILE, 'C:\path\to\cert\ca-bundle.crt');

    If you have any problems you can always look in the Curl_Error method which will return any issues with the cert.

    The cert is available through the release of Curl in PHP at http://curl.haxx.se You can find the certificate file in the lib directory of the release. 

    Regards,
        Barry R.

    IM Support (Feel free to add me)

    MSN: barryruffner@msn.com
    Gmail: barryruffner@gmail.com
    Filed under: , ,
Page 1 of 1 (2 items)