From c45d68256f642fef794fbf57bf4319dd07dcbfe5 Mon Sep 17 00:00:00 2001 From: "ruslan%netscape.com" Date: Fri, 21 Jul 2000 00:03:39 +0000 Subject: [PATCH] Applying Justin's patch to fix 40203 (proxy ssl connect), a=gagan,r=myself --- netwerk/base/src/nsSocketTransport.cpp | 7 +++++-- netwerk/protocol/http/src/nsHTTPRequest.cpp | 11 +++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/netwerk/base/src/nsSocketTransport.cpp b/netwerk/base/src/nsSocketTransport.cpp index f1d9ba89c821..83fbb804d9cd 100644 --- a/netwerk/base/src/nsSocketTransport.cpp +++ b/netwerk/base/src/nsSocketTransport.cpp @@ -788,6 +788,7 @@ nsresult nsSocketTransport::doConnection(PRInt16 aSelectFlags) { PRStatus status; nsresult rv = NS_OK; + PRBool proxyTransparent = PR_FALSE; NS_ASSERTION(eSocketState_WaitConnect == mCurrentState, "Wrong state."); @@ -871,6 +872,7 @@ nsresult nsSocketTransport::doConnection(PRInt16 aSelectFlags) // it do not have to worry about proxy stuff proxyHost = nsnull; proxyPort = -1; + proxyTransparent = PR_TRUE; } } } @@ -974,9 +976,10 @@ nsresult nsSocketTransport::doConnection(PRInt16 aSelectFlags) "rv = %x.\n\n", mHostName, mPort, this, rv)); - if (rv == NS_OK && mSecurityInfo && mProxyHost) { + if (rv == NS_OK && mSecurityInfo && mProxyHost && mProxyHost && proxyTransparent) { // if the connection phase is finished, and the ssl layer - // has been pushed, and we were proxying, it's time + // has been pushed, and we were proxying (transparently; ie. nothing + // has to happen in the protocol layer above us), it's time // for the ssl to "step up" and start doing it's thing. nsCOMPtr securityInfo = do_QueryInterface(mSecurityInfo, &rv); if (NS_SUCCEEDED(rv) && securityInfo) { diff --git a/netwerk/protocol/http/src/nsHTTPRequest.cpp b/netwerk/protocol/http/src/nsHTTPRequest.cpp index f786bc7f0f49..236e01c738fc 100644 --- a/netwerk/protocol/http/src/nsHTTPRequest.cpp +++ b/netwerk/protocol/http/src/nsHTTPRequest.cpp @@ -41,6 +41,7 @@ #include "nsAuthEngine.h" #include "nsIServiceManager.h" #include "nsISocketTransport.h" +#include "nsIPSMSocketInfo.h" #include "plstr.h" #if defined(PR_LOGGING) @@ -884,6 +885,16 @@ nsHTTPPipelinedRequest::RestartRequest(PRUint32 aType) // // XXX/ruslan: need to tell the transport to switch into SSL mode // + nsCOMPtr securityInfo; + rval = mTransport->GetSecurityInfo(getter_AddRefs(securityInfo)); + if (NS_FAILED(rval)) return rval; + + nsCOMPtr psmSocketInfo = do_QueryInterface(securityInfo, &rval); + if (NS_FAILED(rval)) return rval; + + rval = psmSocketInfo->ProxyStepUp(); + if (NS_FAILED(rval)) return rval; + return WriteRequest(mInputStream); }