Get Snoopy work with https.

Help
pyrex
2002-10-14
2003-12-04
  • pyrex

    pyrex - 2002-10-14

    Hi all,

    I just discovered Snoopy which could be very helpful for me.
    I'd like to use it , notably to post an username and a password on a secured jsp page, and get the result from the servlet.
    I tried it with http and it worked well, but as soon as I tried with an https web site it failed:error fetching document.
    I used cURL from the command line and I get the html code from the https Web page. So cURL and OpenSSl are well installed.
    In the Snoopy.class.inc file, I defined my $curl_path="C:\curl", the $port=443 and my host.
    Unfortunately, it still doesn't work, I certainly forgot something to do. If someone has already succeeded in getting
    Snoopy work with https, please let me know.

    Thanks for your help.

    Jerome.

     
    • Anonymous - 2003-12-04

      There is no need for snoopy to use curl or any other complicated methods for ssl.

      In the PHP manual for fsockopen, (which is what snoopy uses to connect using regular http), "joe at edwardsconsultants dot com (10-Aug-2003 08:56)" said that to connect to https you simply need to use 'ssl://' before the host name, and obviously change the port to 443 instead of 80.

      I found this very useful and helpful. See below for how I got snoopy to work without curl.

      To use ssl on the version of snoopy I just downloaded (v1.01) I simply copied the function "_connect" and made one "_connectssl", and changed the proper arguments for fsockopen:

      if($fp = fsockopen(
         "ssl://".$host,
         443,
         $errno,
         $errstr,
         $this->_fp_timeout
         ))
      ...

      I then disabled https wherever it was mentioned in switches and simply told it to use the function "_connectssl" instead of "_connect" for the https. Worked great.

       

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks