From:             abuse at byethost dot org
Operating system: Debian
PHP version:      5.2.9
PHP Bug Type:     Sockets related
Bug description:  Error creating secure socket cnnection

Description:
------------
Creating a SSL connection using fsocket yields an error

My operating system is Debian , and configure line is as follows : 

 './configure' '--prefix=/usr/phpapache2'
'--with-apxs2=/usr/local/apache2/bin/apxs' '--disable-cgi' '--disable-cli'
'--with-config-file-path=/etc/php4/apache' '--enable-inline-optimization'
'--disable-debug' '--disable-rpath' '--disable-static' '--with-layout=GNU'
'--with-pear=/usr/share/php' '--enable-calendar' '--with-bz2'
'--disable-ctype' '--with-iconv' '--enable-exif' '--enable-ftp'
'--with-gettext' '--disable-ipv6' '--disable-wddx' '--disable-posix'
'--with-expat-dir=/usr' '--with-zlib' '--without-pgsql' '--enable-zip=/usr'
'--with-exec-dir=/usr/lib/php4/libexec' '--without-sybase-ct'
'--with-mysql=/usr' '--with-gd' '--with-jpeg-dir=/usr'
'--with-png-dir=/usr' '--with-xpm-dir=/usr' '--with-ttf=shared,/usr'
'--with-t1lib' '--with-freetype-dir=/usr' '--enable-gd-native-ttf'
'--with-sqlite' '--with-mysqli' '--with-xsl' '--enable-ctype'
'--with-pdo-mysql' '--with-xmlrpc' '--without-pdo-sqlite'
'--enable-mbstring' '--disable-inifile' '--disable-flatfile'
'--with-openssl' '--enable-sockets'

running php 5.2.9 

Reproduce code:
---------------
When trying the following code : 

<?php
$fp = fsockopen("ssl://anysecuresite.net" , 443, $errno, $errstr, 30);
if (!$fp) {
    echo "$errstr ($errno)<br />\n";
} else {
    $out = "GET / HTTP/1.1\r\n";
    $out .= "Host: anysecuresite.net\r\n";
    $out .= "Connection: Close\r\n\r\n";
    fwrite($fp, $out);
    while (!feof($fp)) {
        echo fgets($fp, 128);
    }
    fclose($fp);
}
?>

Expected result:
----------------
see the webpage collected 

Actual result:
--------------
Warning: fsockopen() [function.fsockopen]: SSL: connection timeout in
/path/to/file/p.php on line 2

Warning: fsockopen() [function.fsockopen]: Failed to enable crypto in
/path/to/file/p.php on line 2

-- 
Edit bug report at http://bugs.php.net/?id=47791&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=47791&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=47791&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=47791&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=47791&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=47791&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=47791&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=47791&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=47791&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=47791&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=47791&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=47791&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=47791&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=47791&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=47791&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47791&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47791&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=47791&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=47791&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=47791&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=47791&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=47791&r=mysqlcfg

Reply via email to