=?Utf-8?B?ak5vcnRvbg==?=
2005-02-11 06:21:05 AM

I have two servers in a web farm that are (as far as I can tell) configured
exactly the same. One server works fine when runnin the following code, the
other throws an exception. The code and execption are:

HttpWebRequest request;
request =
(HttpWebRequest)WebRequest.Create(@"https://wwwcie.ups.com/ups.app/xml/Track");
HttpWebResponse response;
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = authXml.Length + requestXml.Length;
StreamWriter requestString = new StreamWriter(request.GetRequestStream());
requestString.Write(authXml + requestXml);
requestString.Close();
request.Timeout = 15000;
response = (HttpWebResponse)request.GetResponse();
using (StreamReader sr = new StreamReader(response.GetResponseStream()))
{
return sr.ReadToEnd();
}


EXCEPTION:

System.Net.WebException: The underlying connection was closed: Could not
establish secure channel for SSL/TLS. --->
System.TypeInitializationException: The type initializer for
"System.Net.SecureChannel" threw an exception. --->
System.EntryPointNotFoundException: Unable to find an entry point named
EnumerateSecurityPackagesW in DLL security.dll. at
System.Net.NativeNTSSPI.EnumerateSecurityPackagesW(Int32& pkgnum, IntPtr&
arrayptr) at
System.Net.SSPISecureChannelType.EnumerateSecurityPackages(Int32& pkgnum,
IntPtr& arrayptr) at
System.Net.SSPIWrapper.EnumerateSecurityPackages(SSPIInterface SecModule) at
System.Net.SSPIWrapper.GetSupportedSecurityPackages(SSPIInterface SecModule)
at System.Net.SecureChannel..cctor() --- End of inner exception stack trace
--- at System.Net.SecureChannel..ctor(String hostname,
X509CertificateCollection clientCertificates) at
System.Net.TlsStream.Handshake(ProtocolToken message) --- End of inner
exception stack trace --- at System.Net.HttpWebRequest.CheckFinalStatus() at
System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult) at
System.Net.HttpWebRequest.GetRequestStream() at
NSP.Utilities.UPS.processUPSRequest(String requestXml, UPSRequestType type)


Any ideas?



 

Re: HELP! SSL HTTPRequest Problem

Chris Botha
2005-02-11 09:39:00 AM

I guess it is the certificate issue, IE should prompt you to accept the
certificate if you use IE to connect SSL to the bad server.
There are some links down the group in a thread "Cannot access web server
after enable FIPS compliant cryptography" by Jener Silva dated 2/6/2005 2:14


"jNorton" <jNorton@discussions.microsoft.com>wrote in message
news:DD3A24D7-B0A1-496F-9351-73F3B5B0CAAA@microsoft.com...
>I have two servers in a web farm that are (as far as I can tell) configured
>exactly the same. One server works fine when runnin the following code,
>the
>other throws an exception. The code and execption are:
>
>HttpWebRequest request;
>request =
>(HttpWebRequest)WebRequest.Create(@"https://wwwcie.ups.com/ups.app/xml/Track");
>HttpWebResponse response;
>request.Method = "POST";
>request.ContentType = "application/x-www-form-urlencoded";
>request.ContentLength = authXml.Length + requestXml.Length;
>StreamWriter requestString = new StreamWriter(request.GetRequestStream());
>requestString.Write(authXml + requestXml);
>requestString.Close();
>request.Timeout = 15000;
>response = (HttpWebResponse)request.GetResponse();
>using (StreamReader sr = new StreamReader(response.GetResponseStream()))
>{
>return sr.ReadToEnd();
>}
>
>
>EXCEPTION:
>
>System.Net.WebException: The underlying connection was closed: Could not
>establish secure channel for SSL/TLS. --->
>System.TypeInitializationException: The type initializer for
>"System.Net.SecureChannel" threw an exception. --->
>System.EntryPointNotFoundException: Unable to find an entry point named
>EnumerateSecurityPackagesW in DLL security.dll. at
>System.Net.NativeNTSSPI.EnumerateSecurityPackagesW(Int32& pkgnum, IntPtr&
>arrayptr) at
>System.Net.SSPISecureChannelType.EnumerateSecurityPackages(Int32& pkgnum,
>IntPtr& arrayptr) at
>System.Net.SSPIWrapper.EnumerateSecurityPackages(SSPIInterface SecModule)
>at
>System.Net.SSPIWrapper.GetSupportedSecurityPackages(SSPIInterface
>SecModule)
>at System.Net.SecureChannel..cctor() --- End of inner exception stack
>trace
>--- at System.Net.SecureChannel..ctor(String hostname,
>X509CertificateCollection clientCertificates) at
>System.Net.TlsStream.Handshake(ProtocolToken message) --- End of inner
>exception stack trace --- at System.Net.HttpWebRequest.CheckFinalStatus()
>at
>System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult) at
>System.Net.HttpWebRequest.GetRequestStream() at
>NSP.Utilities.UPS.processUPSRequest(String requestXml, UPSRequestType
>type)
>
>
>Any ideas?
>
>
>