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

2005-11-02 Thread frantisek at augusztin dot com
 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 -  1.103.2.7
+++ ext/ftp/ftp.c   2 Nov 2005 12:22:31 -
@@ -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] [EMAIL PROTECTED]

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] [EMAIL PROTECTED]

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=31971edit=1


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

2005-05-17 Thread frantisek at augusztin dot com
 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:  4.3.11
 New Comment:

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


Previous Comments:


[2005-05-17 11:06:38] [EMAIL PROTECTED]

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



[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.



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=31971edit=1


#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 [NoF-Opn]: ftp_login fails on messsage from FTP+SSL server (234 Enabling SSL)

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

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


Previous Comments:


[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 [NEW]: ftp_login fails on messsage from FTP+SSL server (234 Enabling SSL)

2005-02-14 Thread frantisek at augusztin dot com
From: frantisek at augusztin dot com
Operating system: Linux (Fedora Core 3)
PHP version:  5.0.3
PHP Bug Type: FTP related
Bug description:  ftp_login fails on messsage from FTP+SSL server (234 Enabling 
SSL)

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 bug report at http://bugs.php.net/?id=31971edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31971r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31971r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31971r=trysnapshot51
Fixed in CVS:http://bugs.php.net/fix.php?id=31971r=fixedcvs
Fixed in release:http://bugs.php.net/fix.php?id=31971r=alreadyfixed
Need backtrace:  http://bugs.php.net/fix.php?id=31971r=needtrace
Need Reproduce Script:   http://bugs.php.net/fix.php?id=31971r=needscript
Try newer version:   http://bugs.php.net/fix.php?id=31971r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31971r=support
Expected behavior:   http://bugs.php.net/fix.php?id=31971r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=31971r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=31971r=submittedtwice
register_globals:http://bugs.php.net/fix.php?id=31971r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31971r=php3
Daylight Savings:http://bugs.php.net/fix.php?id=31971r=dst
IIS Stability:   http://bugs.php.net/fix.php?id=31971r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31971r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31971r=float
No Zend Extensions:  http://bugs.php.net/fix.php?id=31971r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31971r=mysqlcfg


#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