Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / August 2005

Tip: Looking for answers? Try searching our database.

Trouble with GET or POST and attaching a cert

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jfulcer - 05 Aug 2005 20:32 GMT
I have a process where I need to do a GET against a URL and receive an
XML response.  I have to verify authenticity with this site, so need a
cert attached to the post.  I was provided ASP code which works fine,
but I need to do this in .NET.  I'm using Framework 1.1 and WSE2.0.
This is (most of) my code:

       Dim certStore As WseX509.X509CertificateStore =
WseX509.X509CertificateStore.LocalMachineStore(WseX509.X509CertificateStore.MyStore)

       Dim open As Boolean = certStore.OpenRead()
       Dim cert2 = GetCertificate("MyCertName", certStore)

       wrequest = CType(WebRequest.Create(url), HttpWebRequest)
       With wrequest
           .Method = "GET"
           .Timeout = 5000
           .ClientCertificates.Add(cert2)
           .KeepAlive = False
       End With

       'get the response from the request
       wresponse = CType(wrequest.GetResponse(), HttpWebResponse)
       ResponseStream = wresponse.GetResponseStream
       'Hook up a streamreader to the stream for ease of reading
       ResponseStreamReader = New
System.IO.StreamReader(ResponseStream)
       strXMLResponse = ResponseStreamReader.ReadToEnd()

The service keeps responding back saying the Cert is not attached - but
I can query it when it's attached to the GET and it looks ok to me.
Any thoughts?
jfulcer - 15 Aug 2005 23:33 GMT
After bouncing around Microsoft's support line for a while, it turns
out that my dev machine was NOT running SP1 for the .NET Framework 1.1.

If you do not have SP1 installed, your web service call will not pass
the certificate along as it cannot access the local machine store
properly.  KB alert # 901183 mentions you need SP1 and now I know why.
It will look like it was passing it, but doesn't.

Cheers!

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.