Re: HTTPS Posting Help needed
- From: "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com>
- Date: Sat, 7 Jan 2006 09:02:07 -0500
Have you tried using the X509Certificate.CreateFromCertFile method rather
than the X509Certificate.CreateFromSignedFile method to read the certificate
from your .cer file?
"Paul Phillips" <PaulPhillips@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C1A2E03F-3864-40B7-9BE0-81E776FA38ED@xxxxxxxxxxxxxxxx
>I have been struggling with this for a couple of weeks.
>
> I have a digital certificate installed in my certificate collection store
> on
> my local computer. The site I am trying to post to also has our
> certificate
> installed is said it is ready to recieve transactions. I have created a
> file
> (xml) and I want to post to the given web address.
>
> An example of the web address is https://some.company.com/location
>
> this is what I have tried:
> aStreamReader = New StreamReader("C:\MyTest2.txt")
> postData = aStreamReader.ReadToEnd()
> Dim data As Byte() = encoding.GetBytes(postData)
>
> Dim myRequest As HttpWebRequest = _
> CType(WebRequest.Create("https://some.company.com/location"), _
>
> HttpWebRequest)
> myRequest.ClientCertificates.Add( _
>
> Security.Cryptography.X509Certificates.X509Certificate.CreateFromSignedFile
> _
>
> ("C:\MyDigitalCertificate.cer"))
> myRequest.Method = "POST"
> myRequest.KeepAlive = False
>
> '*******ERROR occurs on this next line when getting request
> stream******
> Dim newStream As Stream = myRequest.GetRequestStream
> ' Send the data.
> newStream.Write(data, 0, data.Length)
> newStream.Close()
>
> The error is:
> The underlying connection was closed: Could not establish secure channel
> for SSL/TLS.
>
> What am i missing? Is there any examples or articles that would help me?
> Has anyone else ran into this and could shed some light on this? Am I
> just
> way off on doing this?
>
.
- Follow-Ups:
- Re: HTTPS Posting Help needed
- From: Paul Phillips
- Re: HTTPS Posting Help needed
- Prev by Date: Re: SecurityException when app moved to network
- Next by Date: Re: ASP.NET app files security
- Previous by thread: SecurityException when app moved to network
- Next by thread: Re: HTTPS Posting Help needed
- Index(es):
Relevant Pages
|