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

2005-05-13 Thread frantisek at augusztin dot com
 ID:   31971
 User updated by:  frantisek at augusztin dot com
 Reported By:  frantisek at augusztin dot com
 Status:   Open
 Bug Type: FTP related
 Operating System: Linux (Fedora Core 3)
 PHP Version:  4.3.11
 New Comment:

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);



Previous Comments:


[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);



[2005-03-07 01:00:04] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to Open.



[2005-02-22 00:48:29] [EMAIL PROTECTED]

Please provide address of FTP/SSL server which can be used to replicate
the bug.



[2005-02-14 17:32:32] frantisek at augusztin dot com

After examining (and debuging PHP code) i found out, that the ftp_login
function exits after getting the response for PBSZ command (from
ext/ftp/ftp.c, lines 305-313) :

   if (!ftp-old_ssl) {

/* set protection buffersize to zero */
if (!ftp_putcmd(ftp, PBSZ, 0)) {
return 0;
}
if (!ftp_getresp(ftp)) {
return 0; /*  here it exits
}

Why ? What can i do to make it work ? As i said, using regular FTP+SSL
client it works.



[2005-02-14 16:19:47] frantisek at augusztin dot com

Description:

PHP returns following error when connecting using example code:
Warning: ftp_login() : Enabling SSL in /var/www/html/test.php on line
3

Using FTP client the following messages are displayed in the log window
of the client :

*** Connecting to 'XXX.XXX.XXX.XXX:21'...
220 Service Ready for new User
AUTH TLS
234 Enabling SSL

FTP clearly fails on this messsage. But i don't understand why, because
i found in source code, that 234 is not an error, but a valid result
code for this operation.
FTP System type is 215 NETWARE  Type : L8

Reproduce code:
---
?php
$connection = ftp_ssl_connect(server,21);
$login = ftp_login($connection, name,password);
ftp_close($connection);
?

Expected result:

No warning message and successfull connection to FTP server.

Actual result:
--
Warning: ftp_login() : Enabling SSL in /var/www/html/test.php on line 3





-- 
Edit this bug report at http://bugs.php.net/?id=31971edit=1


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

2005-02-14 Thread frantisek at augusztin dot com
 ID:   31971
 User updated by:  frantisek at augusztin dot com
 Reported By:  frantisek at augusztin dot com
 Status:   Open
 Bug Type: FTP related
 Operating System: Linux (Fedora Core 3)
 PHP Version:  5.0.3
 New Comment:

After examining (and debuging PHP code) i found out, that the ftp_login
function exits after getting the response for PBSZ command (from
ext/ftp/ftp.c, lines 305-313) :

   if (!ftp-old_ssl) {

/* set protection buffersize to zero */
if (!ftp_putcmd(ftp, PBSZ, 0)) {
return 0;
}
if (!ftp_getresp(ftp)) {
return 0; /*  here it exits
}

Why ? What can i do to make it work ? As i said, using regular FTP+SSL
client it works.


Previous Comments:


[2005-02-14 16:19:47] frantisek at augusztin dot com

Description:

PHP returns following error when connecting using example code:
Warning: ftp_login() : Enabling SSL in /var/www/html/test.php on line
3

Using FTP client the following messages are displayed in the log window
of the client :

*** Connecting to 'XXX.XXX.XXX.XXX:21'...
220 Service Ready for new User
AUTH TLS
234 Enabling SSL

FTP clearly fails on this messsage. But i don't understand why, because
i found in source code, that 234 is not an error, but a valid result
code for this operation.
FTP System type is 215 NETWARE  Type : L8

Reproduce code:
---
?php
$connection = ftp_ssl_connect(server,21);
$login = ftp_login($connection, name,password);
ftp_close($connection);
?

Expected result:

No warning message and successfull connection to FTP server.

Actual result:
--
Warning: ftp_login() : Enabling SSL in /var/www/html/test.php on line 3





-- 
Edit this bug report at http://bugs.php.net/?id=31971edit=1