#31971 [Fbk->Opn]: [PATCH] ftp_login fails on messsage from FTP+SSL server (234 Enabling SSL)

From: Date: Wed, 02 Nov 2005 12:30:35 +0000
Subject: #31971 [Fbk->Opn]: [PATCH] ftp_login fails on messsage from FTP+SSL server (234 Enabling SSL)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-87399@lists.php.net to get a copy of this message
ID: 31971 User updated by: frantisek at augusztin dot com Reported By: frantisek at augusztin dot com -Status: Feedback +Status: Open Bug Type: FTP related Operating System: Linux (Fedora Core 3) PHP Version: 5CVS, 4CVS (2005-05-18) Assigned To: iliaa New Comment: Patch for PHP 5.0 CVS : --- ext/ftp/ftp.c 17 Mar 2005 17:16:49 -0000 1.103.2.7 +++ ext/ftp/ftp.c 2 Nov 2005 12:22:31 -0000 @@ -281,6 +281,8 @@ return 0; } + SSL_CTX_set_options(ctx,SSL_OP_ALL); + ftp->ssl_handle = SSL_new(ctx); if (ftp->ssl_handle == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create the SSL handle"); @@ -1513,6 +1515,8 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: failed to create the SSL context"); return 0; } + + SSL_CTX_set_options(ctx,SSL_OP_ALL); data->ssl_handle = SSL_new(ctx); if (data->ssl_handle == NULL) { Previous Comments: ------------------------------------------------------------------------ [2005-10-26 16:07:42] iliaa@php.net Can you please provide a patch in unified format. ------------------------------------------------------------------------ [2005-05-17 13:03:54] frantisek at augusztin dot com Nope, it doesn't work. Same error as in first submission. It doesn't read any data after enabling SSL. As i said, enabling special handling of non-conforming SSL servers using this line after ctx variable initialization in both control and data connection helps : SSL_CTX_set_options(ctx,SSL_OP_ALL); ------------------------------------------------------------------------ [2005-05-17 11:06:38] sniper@php.net Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip ------------------------------------------------------------------------ [2005-05-13 15:23:43] frantisek at augusztin dot com The SSL_CTX_set_options must be called for both control and data connection : 264a265 > SSL_CTX_set_options(ctx,SSL_OP_ALL); 1405a1407,1408 > SSL_CTX_set_options(ctx,SSL_OP_ALL); > ------------------------------------------------------------------------ [2005-05-05 12:57:00] frantisek at augusztin dot com Here is the solution (now it works for me) . Here is the diff (against 4.3.11) for file ext/ftp/ftp.c: 265c265,266 < --- > SSL_CTX_set_options(ctx,SSL_OP_ALL); > Yeah, it's one line at 265th line - here is how it looks in source code : ctx = SSL_CTX_new(SSLv23_client_method()); if (ctx == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "ftp_login: failed to create the SSL context"); return 0; } SSL_CTX_set_options(ctx,SSL_OP_ALL); ftp->ssl_handle = SSL_new(ctx); ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/31971 -- Edit this bug report at http://bugs.php.net/?id=31971&edit=1

« previous php.bugs (#87399) next »