Failed to enable crypto

Post any non code related PHP problems here.

Re: Failed to enable crypto

Postby wide_load » Mon Jul 26, 2010 10:54 pm

okay using ssl:// neither of the $err variables are populated.
Image
User avatar
wide_load
Top Contributor
 
Posts: 5375
Joined: Thu Aug 13, 2009 1:04 pm
Online: 12d 14h 21m 3s
Karma: 43

Re: Re: Failed to enable crypto

Advertisment

Advertisment
 

Re: Failed to enable crypto

Postby Hydraulics » Thu Jul 29, 2010 2:13 am

What are you trying to achieve with this?

Using the php manual's fsockopen function:

  1. <?php
  2.  
  3. $fp = fsockopen("ssl://www.paypal.com", 443, $errno, $errstr, 30);
  4. if (!$fp) {
  5.     echo "$errstr ($errno)<br />\n";
  6. } else {
  7.     $out = "GET / HTTP/1.1\r\n";
  8.     $out .= "Host: www.example.com\r\n";
  9.     $out .= "Connection: Close\r\n\r\n";
  10.     fwrite($fp, $out);
  11.     while (!feof($fp)) {
  12.     echo '<pre>';
  13.         echo fgets($fp, 128);
  14.     echo '</pre>';
  15.     }
  16.     fclose($fp);
  17. }



All I get is this:

HTTP/1.1 302 Found
Date: Thu, 29 Jul 2010 01:05:25 GMT
Server: Apache
Set-Cookie: cwrClyrK4LoCV1fydGbAxiNL6iG=%7cWsI5nqD1FY1Vf6pTP9DTyFtJHzChSYpInyjR7KNO06rh4xHD7tP5SwKZ2HuRvonSRJ2EMW%7cHsD_dRWQPAg
eO8u048oCLPK5Px60Rk31oR3sDyRbSlEPl7CwVK5Azp1fGrW6nt8-vX2q4m%7c; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: cookie_check=yes; expires=Sun, 26-Jul-2020 01:05:25 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: Apache=10.190.11.254.1280365525106073; path=/; expires=Tue, 14-Jun-04 18:37:09 GMT
Location: https://www.paypal.com/cgi-bin/webscr
Vary: Accept-Encoding
Strict-Transport-Security: max-age=500
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html
0
Hydraulics
 
Posts: 67
Joined: Tue Sep 01, 2009 10:57 pm
Online: 5h 17m 17s
Karma: 1

Re: Failed to enable crypto

Postby wide_load » Thu Jul 29, 2010 9:07 am

im trying to achieve a secure connection to paypal.

and if you notice, that's how im using the function.

I already said I think its a set up error.
Image
User avatar
wide_load
Top Contributor
 
Posts: 5375
Joined: Thu Aug 13, 2009 1:04 pm
Online: 12d 14h 21m 3s
Karma: 43

Re: Failed to enable crypto

Postby Cags » Thu Jul 29, 2010 10:13 am

Have you got the openssl extension enabled?
"I don't suffer from insanity, I enjoy every minute of it."
- Pete
CodeCanyon - Cheap, High Quality, Ready Made Scripts.
User avatar
Cags
Moderator
 
Posts: 1816
Joined: Fri May 22, 2009 9:35 am
Location: Purgatory
Online: 2d 12h 47m 44s
Karma: 7

Re: Failed to enable crypto

Postby wide_load » Thu Jul 29, 2010 10:15 am

Cags wrote:Have you got the openssl extension enabled?


I have, and the openssl functions work.
Image
User avatar
wide_load
Top Contributor
 
Posts: 5375
Joined: Thu Aug 13, 2009 1:04 pm
Online: 12d 14h 21m 3s
Karma: 43

Previous

Return to PHP Other

Who's online?

Users browsing this forum: No registered users and 1 guest