Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Problems with Security Certificates and Secure Servers

Reply
Thread Tools

Problems with Security Certificates and Secure Servers

 
 
leeo
Guest
Posts: n/a
 
      06-29-2006
Hi

We're using the following code to send data to a secure server and then
get a response back from it:

System.Net.ServicePointManager.CertificatePolicy = New
cCertificatePolicy

wr = CType(WebRequest.Create(goSettings.NHSDPBClaimsURL ),
HttpWebRequest)
nc = New NetworkCredential(goSettings.NHSUserName,
goSettings.NHSPassword)

wr.Credentials = nc
wr.ContentType = "text/xml"
wr.Method = "POST"

xd = New XmlDocument
xd.Load(gsAppPath & "\temp.xml")

xw = New XmlTextWriter(wr.GetRequestStream(), Nothing)

xd.WriteTo(xw)

xw.Close()

ws = CType(wr.GetResponse(), HttpWebResponse) <-- problem
here

sr = ws.GetResponseStream()

rd = New StreamReader(sr)

Now at first we had a hell of a time just being able to connect to the
server until we found some useful tips on google groups about setting
up our own certificate policy which always returns true on the
CheckValidationResult method. This now allows us to send the data to
the server correctly, however when it reaches the line that gets a
reponse from the server, it falls over with the same old "Could not
establish secure channel for SSL/TLS" even though it has clearly run
the new policy and already uploaded data to using the webrequest
object. The strange thing is, if the whole routine is run again by
pressing the send button a second time it works fine.

Does anyone know why we would be getting this problem, or a method to
correct it?

Thanks

Lee

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Secure your digital information assets with Secure Auditor. SecureWindows with Secure Auditor alannis.albert@googlemail.com Cisco 0 04-14-2008 06:53 AM
Secure your digital information assets with Secure Auditor SecureWindows with Secure Auditor alannis.albert@googlemail.com Cisco 0 04-14-2008 06:52 AM
Are SSL certificates and x.509 certificates the same? n33470 ASP .Net Web Services 0 12-14-2005 03:30 PM
Self-issued certificates and commercial certificates. Lord Amoeba Computer Security 2 05-05-2004 01:40 PM



Advertisments