#6156: Warning raised when posting over SSL in http_socket
---------------------------+------------------------------------------------
    Reporter:  Caveman     |         Owner:           
        Type:  Bug         |        Status:  new      
    Priority:  Low         |     Milestone:  1.3.x.x  
   Component:  Core Libs   |       Version:  1.2 Final
    Severity:  Minor       |    Resolution:           
    Keywords:              |   Php_version:  n/a      
Cake_version:  1.2.1.8004  |  
---------------------------+------------------------------------------------
Changes (by sluniicko):

  * milestone:  1.2.x.x => 1.3.x.x

Old description:

> A warning is raised when posting a form accross an SSL connection.  A
> simple example is to try
>
> // Create a HttpSocket
> $this->browser = new HttpSocket;
>
> // Try it to make sure it works, perhaps catch some cookies...
> $r = $this->browser->get('http://www.facebook.com/');
>
> // POST a form by HTTPS, for example
> $r =
> $this->browser->post('https://login.facebook.com/login.php?login_attempt=1',
> array('email'=>'*cough*', 'pass'=>'*cough*'));
>
> leads to a warning...
>
> Warning (2): fread() [function.fread]: SSL: fatal protocol error
> [CORE/cake/libs/socket.php, line 221]
>
> $length = 1024
>
> fread - [internal], line ??
> CakeSocket::read() - CORE/cake/libs/socket.php, line 221
> HttpSocket::request() - CORE/cake/libs/http_socket.php, line 247
> HttpSocket::post() - CORE/cake/libs/http_socket.php, line 297
> SamplesController::other() - APP/controllers/samples_controller.php, line
> 105
> Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
> Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 245
> Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 211
> [main] - APP/webroot/index.php, line 88
>
> It is known that using \r\n as the header new line across an SSL
> connection to some servers causes an error (not a warning) on reading.
>
> I've been trying to find a fix, but so far I have had no joy.  I tried
> replacing two lines in httpsocket.php (224 and 775) that use \r\n with
> $this->lineBreak and also tried changing the read buffer to 5096, but
> neither solved the problem.

New description:

 A warning is raised when posting a form accross an SSL connection.  A
 simple example is to try

 {{{
 // Create a HttpSocket
 $this->browser = new HttpSocket;

 // Try it to make sure it works, perhaps catch some cookies...
 $r = $this->browser->get('http://www.facebook.com/');

 // POST a form by HTTPS, for example
 $r =
 $this->browser->post('https://login.facebook.com/login.php?login_attempt=1',
 array('email'=>'*cough*', 'pass'=>'*cough*'));

 leads to a warning...

 Warning (2): fread() [function.fread]: SSL: fatal protocol error
 [CORE/cake/libs/socket.php, line 221]

 $length = 1024

 fread - [internal], line ??
 CakeSocket::read() - CORE/cake/libs/socket.php, line 221
 HttpSocket::request() - CORE/cake/libs/http_socket.php, line 247
 HttpSocket::post() - CORE/cake/libs/http_socket.php, line 297
 SamplesController::other() - APP/controllers/samples_controller.php, line
 105
 Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
 Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 245
 Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 211
 [main] - APP/webroot/index.php, line 88
 }}}

 It is known that using \r\n as the header new line across an SSL
 connection to some servers causes an error (not a warning) on reading.

 I've been trying to find a fix, but so far I have had no joy.  I tried
 replacing two lines in httpsocket.php (224 and 775) that use \r\n with
 $this->lineBreak and also tried changing the read buffer to 5096, but
 neither solved the problem.

Comment:

 Fixing milestone and wiki formatting of description

-- 
Ticket URL: <https://trac.cakephp.org/ticket/6156#comment:1>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design 
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. 
Our primary goal is to provide a structured framework that enables PHP users at 
all levels to rapidly develop robust web applications, without any loss to 
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tickets cakephp" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to