Fread + Ssl

Reply

Join Date: May 2005
Posts: 2
Reputation: John Smith is an unknown quantity at this point 
Solved Threads: 0
John Smith John Smith is offline Offline
Newbie Poster

Fgets + Ssl

 
0
  #1
May 13th, 2005
Hi,

Im having a slight problem with fgets and ssl.
  1. <?php
  2.  
  3.  
  4. function monkey($method,$protocal,$port,$domain,$path,$data,$query){
  5.  
  6.  
  7. if($method=="POST"){
  8.  
  9.  
  10. $fp = fsockopen($protocal."://".$domain, $port, $errno, $errstr, 30);
  11.  
  12. if (!$fp) {
  13. echo $errstr." (".$errno.")<br />\n";
  14. } else {
  15. $out .= "POST /".$path."?".$query." HTTP/1.1\r\n";
  16. $out .= "Host: ".$domain."\r\n";
  17. $out .= "Content-Type: application/x-www-form-urlencoded\r\n";
  18. $out .= "Content-Length: " . strlen($req) . "\r\n";
  19. $out .= "Connection: Close\r\n\r\n";
  20. $out .= $req;
  21.  
  22. fputs ($fp, $out);
  23. while (!feof($fp)) {
  24. echo fgets($fp, 128);
  25. }
  26. fclose($fp);
  27. }
  28.  
  29. }
  30. }
  31. $data['foo']="Hello Post data";
  32. monkey("POST","ssl","443","domaingoeshere.com","",$data,"a=blag");
  33.  
  34. ?>

Fgets throws an error at me.
Is there something obvious that ive done wrong?
Apache is settup correctly and php is compiled with ssl support.
Last edited by John Smith; May 13th, 2005 at 5:20 am. Reason: Ooops
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 2
Reputation: John Smith is an unknown quantity at this point 
Solved Threads: 0
John Smith John Smith is offline Offline
Newbie Poster

Re: Fread + Ssl

 
0
  #2
May 13th, 2005
When connecting to hotmail I get this error:
(Through POST and SSL)

(1)HTTP/1.1 200 OK
(2)Cache-Control: no-cache
(3)Pragma: no-cache
(4)Content-Length: 312
(5)Content-Type: text/html
(6)Expires: Fri, 13 May 2005 08:33:37 GMT
(7)Server: Microsoft-IIS/6.0
(8)PPServer: PPV: 25 H: TK2PPMLOG2B03 V: 1192
(9)cachecontrol: no-store
(10)P3P: CP="DSP CUR OTPi IND OTRi ONL FIN"
(11)Date: Fri, 13 May 2005 08:34:36 GMT
(12)Connection: close
(13)
<br />
<b>Warning</b>: fgets(): SSL: fatal protocol error in <b>/home/william/public_html/hotmail.php</b> on line <b>46</b><br />
(14)<HTML><HEAD>.... (page content)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum


Views: 2526 | Replies: 1
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC