Ask a Question related to ASP.NET Security, Design and Development.
-
Will #1
Host never gets my certificate?.
It seems that I have scoured the net and came up empty
handed.
I have an ASP.net app that posts xml to another company's
servlet. For some transactions, they do not require a
certificate, but others do. I started building this app
with the transactions that did not require the cert, but
put in the code to use the cert anyhow. I have been
running for several months thinking that I was using my
cert, but now that I'm trying to build the transactions
that REQUIRE the cert- It turns out that the cert is not
ACTUALLY being used.
I called my contact at the other company and they say
their system never sees my cert being used.
I'm using what appears to be the 'standard' code that
eveyone else uses:
//################################################## ######
########
....Load XML
HttpWebRequest objRequest = (HttpWebRequest)
WebRequest.Create
("https://other.large.company.com/theirServlet");
objRequest.Method = "POST";
objRequest.ContentLength = xmlDoc.InnerXml.Length;
objRequest.ContentType = "text/xml";
objRequest.Timeout = 30000;
objRequest.ClientCertificates.Add
(X509Certificate.CreateFromCertFile
(Global.appPath+@"cert.cer"));
//
//ServicePointManager.CertificatePolicy = new CertPolicy
();
//
Response.Write
("certcount="+objRequest.ClientCertificates.Count. ToString
()+"<BR>");
....POST XML
....Get Response
....Process Response XML
ServicePoint sp = ServicePointManager.FindServicePoint
(objRequest.RequestUri);
if(sp.ClientCertificate!=null) Response.Write
("sp.ClientCertificate = "+sp.ClientCertificate.GetName()
+"<BR>");
else Response.Write("ClientCertificate is null<BR>");
if(sp.Certificate!=null) Response.Write("sp.Certificate
= "+sp.Certificate.ToString(true)+"<BR>");
else Response.Write("Certificate is null<BR>");
//################################################## ######
########
RESPONSE.WRITE OUTPUTS:
certcount=1
ClientCertificate is null
sp.Certificate = CERTIFICATE: Format: X509 Name: C=US,
S=Missouri, O=.....(edited out- this is the other
company's cert)
I've tried the "new CertPolicy()" route, but it doesn't
change anything. The Response.Write shows "certcount=1",
so it seems that it is loading it. I used GetName() on it
and it was the correct cert too. I'm not sure if
sp.Certificate sould have MY cert listed or theirs (as it
does).
The cert is installed on the server. I installed the
cert.pfx file and then exported it to cert.cer. In old
ASP, I had to use winhttpcertcfg.exe to give the
IWAM_COMPUTER user access to the cert, so I did this
again. But still nothing.
Oddly, the cert is under CURRENT_USER\MY where as before
it was under LOCAL_MACHINE\MY. Does this make a
difference?
I read somewhere that HttpWebRequest looks at the cert I
loaded, finds it in the store, and then uses it.
This is the only way for it to get the Private Key? Is
this true?
If so, then how do I know if it found it in the store? or
didn't?
How else can I possibly make a connection like
this!? .cer files don't have the Private Key. The Private
Key is required!
It is very hard to find the problem when there isn't any
kind of 'status' or monitoring of the actual connection
AND no errors. The other company just returns XML
saying "Basic authorization is not allowed for this
transaction".
-Hope someone can help!
-Will.K
..
Will Guest
-
Check SSL certificate?
What I want is to ensure that my app always connects only to my server (https). If someone puts https proxy in the middle it's possible to intercept... -
Win32::OLE and CAPICOM to find a certificate in certificate store will raise exception
Hi, I am trying to use win32::OLE to access certificate store via CAPICOM. If certificates in the store meet the searching criteria, the... -
SSL Certificate
We're trying to get a SSL certificate set up. But we keep getting a "connection terminated unexpectedly" error. And nothing is being recorded in... -
DLAP and Certificate
I want to be able to retrieve all the people who have a certificate but I don't know what the expression for that. I know for sure this person has... -
Certificate Server and Windows XP - Cannot install certificate
Hello all, I would like to implement certificate server. I have installed the service on Win2003 server in standalone mode. I have created from...



Reply With Quote

