Skip to content

URL for CONNECT messages is inconsistent between secure and non-secure connections. #236

Closed
@jakeyr

Description

@jakeyr

When using a ProxyServer over SSL (connect tcp mode), async-http-client will produce a garbled HTTP request. The following code will reproduce the problem:

AsyncHttpClient client = new AsyncHttpClient();
Response response = client.preparePost("https://www.google.com/")
        .setBody(new ByteArrayInputStream("TEST TEST".getBytes("utf-8")))
        .setProxyServer(new ProxyServer("localhost", 8888))
        .execute().get();

System.out.println(response.getResponseBody());

The resulting HTTP request will use the following HTTP request string:

POST https://www.google.com HTTP/1.1

The request string should be:

POST / HTTP/1.1

I've verified that using SSL without proxy, or proxy without SSL, does not cause the problem.

This problem is reproducible in at least 1.6.5, 1.7.4, and 1.7.10.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions