x509 cert not being submitted

From: RP (rp@nospam.com)
Date: 02/14/03

  • Next message: Joe Kaplan: "Re: How to get domain\username (NT account) from a DirectoryEntry object of user?"
    From: "RP" <rp@nospam.com>
    Date: Fri, 14 Feb 2003 11:44:05 -0500
    
    

    Ok, I am trying to attach a certificate to a httpwebrequest and send it.
    After some debugging on the server-side I have noticed that the certificate
    is not being sent at all. And the problem is that i get no error on the
    client code while doing the attaching. what could be wrong? If I browse to
    the url in IE works fine!

      Dim h as httpwebrequest
      h = Ctype(WebRequest.Create(strsecureurl), httpwebrequest)
      Dim mycert as X509Certificate =
    X509Certificate.CreateFromCertFile("c:\mycert.cer")
      h.clientcertificates.add(mycert)

      h.contenttype = "text/xml"
      h.method = "GET"

      Dim hr as httpwebresponse = Ctype(h.getresponse(), httpwebresponse)
      Dim s2 as stream = hr.getresponsestream()
      Dim sr as new streamreader(s2)
      returnstr = sr.readtoend()
      sr.close()

    any help would be much appreciated.

    thanks,
    Param



    Relevant Pages

    • Re: using p12 Certificate - converting to x509 What am I doing wrong?
      ... their staff sent it to me in .pfx format for me to import password ... Dim h as httpwebrequest ... So i wrote a small aspx page that checked for the certificate on ...
      (microsoft.public.dotnet.security)
    • Re: using p12 Certificate - converting to x509 What am I doing wrong?
      ... but .net currently only supports binary DER ... > Dim h as httpwebrequest ... > h = Ctype, httpwebrequest) ... So i wrote a small aspx page that checked for the certificate on ...
      (microsoft.public.dotnet.security)
    • exception using HTTPWebRequest with SSL
      ... I'm using the HTTPWebRequest class to connect to a web site with SSL. ... and then use the X509Certificate class to add the certificate to ... How do I install the certificate in the LOCAL_MACHINE hive instead of the ... Dim myHttpWebRequest As HttpWebRequest ...
      (microsoft.public.dotnet.languages.vb)
    • Re: socket error
      ... It ended up with something to do with our Proxy configuration. ... but on the 2.0 box for some reason the httpwebrequest couldnt ... Yes I can visit that page directly through a browser on the server. ... >> | Dim returnstr As String ...
      (microsoft.public.dotnet.framework.aspnet)
    • The remote server returned an error: (404) Not Found
      ... I am facing an Exception "The remote server returned an error: ... by using "getRequestStream" method of HttpWebRequest object to send data. ... Dim strPostData As New StringBuilder ... Dim objWebRequest As HttpWebRequest = ...
      (microsoft.public.dotnet.framework.aspnet.webcontrols)