Re: "The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel"



You're making a remote method call to a network service. Any time you do
such a thing, your app has a dependency upon something it has no control
over, and which is dependent upon a variety of circumstances over which your
app has no control. Therefore, you cannot expect it to always succeeed.
There are so many things that can go wrong with an Internet messaging
connection that it is amazing that the Internet works at all. Part of the
reason is that there are safeguards built into networked systems, such as
redundancy, round-robin, and Cyclic Redundancy Checks, and so on.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Brenton Unger - MCSD.NET" <brenton@xxxxxxxxxxxx> wrote in message
news:1177623341.491462.202080@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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);



.



Relevant Pages

  • Re: IIS6 Network Service Identity - when needed?
    ... This is because an application's permissions is something that a developer ... corresponding app pools) based on the characteristics of the .Net code. ... can/can't run with the Network Service identity. ... administrative-level privileges. ...
    (microsoft.public.inetserver.iis.security)
  • Re: Create a shortcut in SendTo menu
    ... whatsoever would I want my app dependent on VB's Setup Toolkit DLL. ... A MUCH better alternative is to use the IShellLink interface. ... I'd rather stick with a dependency on the WSH. ... >>>lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal ...
    (microsoft.public.vb.general.discussion)
  • Re: ASPNET user writing to a subfolder
    ... The NETWORK SERVICE identity has also been confusing me. ... > ASP.NET runs as ASPNET on pre-windows 2003 and NETWORK SERVICE user on> windows 2003 by default. ... When IIS is in anonymous mode, ASP.NET app runs as ASPNET(or NETWORK ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: IIS6 on DC failing ASP.Net Service Unavailable
    ... I was afraid of needing IISState, given that it means debug symbols and all ... The app doesn't work with Network Service because I can't give it any perms ...
    (microsoft.public.inetserver.iis)
  • Re: link shared libs independent of lib version
    ... You need to remove that dependency as well. ... Your goal is make the app work "out of the box" (at least that's ... eliminate libstdc++ and libgcc_s dependency. ... In order to understand recursion you must first understand recursion. ...
    (comp.unix.programmer)