B
Brenton Unger - MCSD.NET
Alright Googler Groupers!
I've searched high and low and tried everything I care to, so I'll see
what the masses can conclude! I'm making both UPS and PayPal calls and
both of them *occaisionally* throw this error. Please help!
The error I receive is :
"The underlying connection was closed: Could not establish trust
relationship for the SSL/TLS secure channel"
The inner exception is:
"The remote certificate is invalid according to the validation
procedure"
My web.config has:
<system.net>
<settings>
<servicePointManager checkCertificateName="false"
checkCertificateRevocationList="false"/>
</settings>
<connectionManagement>
<add address="*" maxconnection="12"/>
</connectionManagement>
</system.net>
My Global.asax has:
ServicePointManager.CertificatePolicy = new CertificatePolicy();
ServicePointManager.ServerCertificateValidationCallback = new
RemoteCertificateValidationCallback(ValidationCallBack);
My CertificationPolicy class looks like:
public bool CheckValidationResult(ServicePoint sp, X509Certificate
cert, WebRequest req, int problem)
{
return true;
}
And finally, my code is:
HttpRequestHandler http = new HttpRequestHandler(connectionURL);
string response = http.POST(stuffToPost);
I've searched high and low and tried everything I care to, so I'll see
what the masses can conclude! I'm making both UPS and PayPal calls and
both of them *occaisionally* throw this error. Please help!
The error I receive is :
"The underlying connection was closed: Could not establish trust
relationship for the SSL/TLS secure channel"
The inner exception is:
"The remote certificate is invalid according to the validation
procedure"
My web.config has:
<system.net>
<settings>
<servicePointManager checkCertificateName="false"
checkCertificateRevocationList="false"/>
</settings>
<connectionManagement>
<add address="*" maxconnection="12"/>
</connectionManagement>
</system.net>
My Global.asax has:
ServicePointManager.CertificatePolicy = new CertificatePolicy();
ServicePointManager.ServerCertificateValidationCallback = new
RemoteCertificateValidationCallback(ValidationCallBack);
My CertificationPolicy class looks like:
public bool CheckValidationResult(ServicePoint sp, X509Certificate
cert, WebRequest req, int problem)
{
return true;
}
And finally, my code is:
HttpRequestHandler http = new HttpRequestHandler(connectionURL);
string response = http.POST(stuffToPost);