From:             david at blue-labs dot org
Operating system: Linux
PHP version:      5.2.0
PHP Bug Type:     Sockets related
Bug description:  fsockopen(tls://...) starts SSL instead of TLS

Description:
------------
(this is actually php 5.1.6)

using the tls target, fsockopen() tries to negotiate SSL instead of
starting a connection and negotiating STARTTLS.



Reproduce code:
---------------
Scott PHP # cat tls-test.php
<?
$fp = fsockopen("tls://mail.blue-labs.org", 25, $errno, $errstr);
?>



Expected result:
----------------
I expect it to open a connection and negotiate STARTTLS.  ssl:// should
start an SSL connection, tls:// should start a TLS connection

Actual result:
--------------
Scott PHP $ php ./tls-test.php

Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error
messages:
error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number in
/home/david/svn/BlueLabs/BlueList/PHP/tls-test.php on line 3

Warning: fsockopen(): Failed to enable crypto in
/home/david/svn/BlueLabs/BlueList/PHP/tls-test.php on line 3

Warning: fsockopen(): unable to connect to tls://mail.blue-labs.org:25
(Unknown error) in /home/david/svn/BlueLabs/BlueList/PHP/tls-test.php on
line 3

(trimmed for brevity)

NOQUEUE: connect from [69.167.98.28]
AUTH: available mech=CRAM-MD5, allowed mech=DIGEST-MD5 CRAM-MD5 LOGIN
PLAIN
 --- 220-sunny-beach.m2000inc.com ESMTP
 --- 220
 <-- \026\003\001
 --- 500 5.5.1 Command unrecognized: "\026\003\001"
 <--
 --- 500 5.5.1 Command unrecognized: ""
 --- 421 4.4.1 sunny-beach.m2000inc.com Lost input channel from
[69.167.98.28]
[69.167.98.28] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA


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

Reply via email to