Applying Justin's patch to fix 40203 (proxy ssl connect), a=gagan,r=myself

This commit is contained in:
ruslan%netscape.com 2000-07-21 00:03:39 +00:00
parent 2071a70c11
commit c45d68256f
2 changed files with 16 additions and 2 deletions

View File

@ -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<nsIPSMSocketInfo> securityInfo = do_QueryInterface(mSecurityInfo, &rv);
if (NS_SUCCEEDED(rv) && securityInfo) {

View File

@ -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<nsISupports> securityInfo;
rval = mTransport->GetSecurityInfo(getter_AddRefs(securityInfo));
if (NS_FAILED(rval)) return rval;
nsCOMPtr<nsIPSMSocketInfo> psmSocketInfo = do_QueryInterface(securityInfo, &rval);
if (NS_FAILED(rval)) return rval;
rval = psmSocketInfo->ProxyStepUp();
if (NS_FAILED(rval)) return rval;
return WriteRequest(mInputStream);
}