dbalatero/typhoeus — Issue #144: SSL via HTTP Proxies does not work
Author: andrewg-felinemenace
Created: 2012-03-01 00:08:07+00:00
State: open

When accessing HTTPS websites behind a HTTP Proxy, the body has the results of the SSL handshake message sent by the server. The following code snippet demonstrates the problem. (Of course, HTTPS_PROXY must be set to a suitable proxy address).

```ruby
require 'typhoeus'

response = Typhoeus::Request.get("https://mail.google.com",
:disable_ssl_host_verification => true,
:disable_ssl_peer_verification => true,
:ssl_version => :sslv3,
:proxy => ENV["HTTPS_PROXY"],
)

puts response.inspect
```

The output from this is

```ruby
# :get,
:url => https://mail.google.com, @effective_url="https://mail.google.com", @primary_ip="1.2.3.4", @mock=false>
```

It works as expected if no ENV["HTTPS_PROXY"] is present. The initial \x16\x03\x00 is the first few of bytes that the SSLv3 protocol sends for handshaking, so it looks as if the information is not being passed to a SSL handler and the correct request is being sent.