mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-26 03:35:33 +00:00
Bug 89206. Get HTTP/HTTPS to work with socks proxies. Other protocols are
broken though, and have been for some time. r/sr=dougt, sr=smfr
This commit is contained in:
parent
bcf02f1d15
commit
d8a192342c
@ -293,10 +293,12 @@ nsHttpChannel::SetupTransaction()
|
||||
NS_ADDREF(mTransaction);
|
||||
|
||||
// use the URI path if not proxying (transparent proxying such as SSL proxy
|
||||
// does not count here).
|
||||
// or socks does not count here).
|
||||
nsXPIDLCString requestURIStr;
|
||||
const char* requestURI;
|
||||
if ((mConnectionInfo->ProxyHost() == nsnull) || mConnectionInfo->UsingSSL()) {
|
||||
if (!mConnectionInfo->ProxyHost() ||
|
||||
mConnectionInfo->UsingSSL() ||
|
||||
!PL_strcmp(mConnectionInfo->ProxyType(), "socks")) {
|
||||
rv = mURI->GetPath(getter_Copies(requestURIStr));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
requestURI = requestURIStr.get();
|
||||
|
@ -340,7 +340,10 @@ nsHttpConnection::ActivateConnection()
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// need to handle SSL proxy CONNECT if this is the first time.
|
||||
if (mConnectionInfo->UsingSSL() && mConnectionInfo->ProxyHost()) {
|
||||
// unless its SOCKS.
|
||||
if (mConnectionInfo->UsingSSL() &&
|
||||
mConnectionInfo->ProxyHost() &&
|
||||
PL_strcmp(mConnectionInfo->ProxyType(), "socks")) {
|
||||
rv = SetupSSLProxyConnect();
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
@ -433,15 +436,17 @@ nsHttpConnection::CreateTransport()
|
||||
// configure the socket type based on the connection type requested.
|
||||
const char *types[3] = {0,0,0};
|
||||
PRUint32 count = 0;
|
||||
if (mConnectionInfo->UsingSSL()) {
|
||||
types[0] = "ssl";
|
||||
count++;
|
||||
}
|
||||
|
||||
if (!PL_strcasecmp(mConnectionInfo->ProxyType(), "socks")) {
|
||||
types[count] = "socks";
|
||||
count++;
|
||||
}
|
||||
|
||||
if (mConnectionInfo->UsingSSL()) {
|
||||
types[count] = "ssl";
|
||||
count++;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsITransport> transport;
|
||||
rv = sts->CreateTransportOfTypes(count, types,
|
||||
mConnectionInfo->Host(),
|
||||
|
Loading…
Reference in New Issue
Block a user