Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Error when trying to connect over HTTPS using a client certificate.

Reply
Thread Tools

Error when trying to connect over HTTPS using a client certificate.

 
 
Subra Mallampalli
Guest
Posts: n/a
 
      10-02-2003
Hi,

I am trying to connect over HTTPS using a client certificate. I am able to
connect fine when using IE. From my application, however, I get the
following error:

The underlying connection was closed: Could not establish secure channel for
SSL/TLS.
at System.Net.HttpWebRequest.CheckFinalStatus() at
System.Net.HttpWebRequest.EndGetRequestStream(IAsy ncResult asyncResult) at
System.Net.HttpWebRequest.GetRequestStream() at Project1.Page_Load(Object
sender, EventArgs e) in
d:\temp\vswebcache\myMachine\project1\webform1.asp x.cs:line 47.

I have installed the certificate on the development machine and the
certificate has the private key included. From the application, I use a
DER-encoded X.509 certificate which does not include the private key. I am
able to read the certificate and its properties from within the application,
so I know the certificate is fine.

I am attaching the code that I am using. Any help would be greatly
appreciated!

Thanks,

Subra
************************************************** *

ServicePointManager.CertificatePolicy = new CertificatePolicy();
X509Certificate cert = X509Certificate.CreateFromCertFile(certfile);
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.ClientCertificates.Add(cert);
req.Method = "POST";
req.KeepAlive = false;
req.ContentLength = requestXML.Length;
Stream reqStream = req.GetRequestStream(); //******** error occurs on this
line.
StreamWriter sw = new StreamWriter(reqStream);
sw.Write(requestXML);
sw.Close();
************************************************** *


 
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
Trying to connect to an https://domain.com URL via Java and failingto do so Rob Java 3 05-08-2012 03:09 AM
VOIP over VPN over TCP over WAP over 3G Theo Markettos UK VOIP 2 02-14-2008 03:27 PM
Error when trying to connect over HTTPS using a client certificate. Subra Mallampalli ASP .Net Web Services 0 10-02-2003 09:53 PM
Error when trying to connect over HTTPS using a client certificate. Subra Mallampalli ASP .Net 0 10-02-2003 09:53 PM
Error when trying to connect over HTTPS using a client certificate. Subra Mallampalli ASP .Net 0 10-02-2003 07:22 PM



Advertisments