Re: HttpListener, SSL Certificates, Sever and client certificate auth



That error indicates that there is no keyset for the SSL cert. Are you sure
the process you used for getting the SSL cert didn't lose the private key?
You can open up the cert in the certificates MMC and see if it says it has a
private key associated with it.

It may also be a permissions problem where your service process doesn't have
the right permissions to read the key or it may be a profile problem where
you have the private key stored in some user's local profile instead of in
the local machine store and thus your service process can't get to it.

HTH!

Joe K.
--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"Colin" <Colin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DEA98F09-EF73-4274-83D4-65A9E0C15B9E@xxxxxxxxxxxxxxxx
Can someone please tell me what I am doing wrong. I have been working on
this issue for quite some time.

I have developed a lightweight http server using HttpListener. I want to
use SSL certificates to authenticate both the server to the client and the
client to the server.

When I create a self signed root CA using makecert, then create a server
authentication certificate and a client authentication certificate using
makecert, everything works fine. The client and the server exchange
certificates and it all works. This is great for development, not so
great
for a production environment.

When I use a server running certificate services to create certificates,
the
server disconnects the client. The client application receives an
exception
of:

System.Net.WebException: The underlying connection was closed: An
unexpected
err
or occurred on a send. ---> System.IO.IOException: Authentication failed
because
the remote party has closed the transport stream.

I am using a stand alone machine running certificate services. It is a
root
CA.
When using certificate services, I use a web browser to go to the
certificate services web interface. I install the root CA certificate,
then
I request a new server auth certificate. Then I issue the certificate on
the
CA machined, then I install the certificate using the web interface. Then
I
do the same for the client certificate.

Then I use httpcfg to configure the port.

If I use the makecert certificates all is well.

If I use the certficate services certificates, it fails.

Obviously I have some configuration issue or I am just not doing something
right. I have no idea.

Anyone know what I am doing wrong? Any ideas about how to debug the
issue?

I have turned on SCHANNEL debugging and something of interest is when I
use
the microsoft server certificates I get an error in the event log:

A fatal error occurred when attempting to access the SSL server credential
private key. The error code returned from the cryptographic module is
0x80090016

I don't get this error with the makecert certificates.

Please help, thank you.


.



Relevant Pages

  • Re: Need for encryption in WSE 3.0 if using SS-avoid man-in-middle
    ... SSL only validates you are talking to a SSL certified server; ... They can simply edit the URL the client program ... can be done by using a X.509 certificate on both ends, ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: LDP client authentication fails
    ... I got the LDP working with LDAP server under server client authentication ... I did not installed the certificate in pfx format .. ... Client cert auth won't work without that. ...
    (microsoft.public.windows.server.active_directory)
  • Re: SSL & Man In the Middle Attack
    ... >> it possible for the middle man to intercept all messages from server to me ... > server sends client a signed message along with a digital certificate. ... > client generates a random secret key, ...
    (comp.security.misc)
  • Re: activesync issue
    ... On the SBS 2003 Server open the Server Management console. ... On the "Web Server Certificate" page, choose to create a new Web server ... Install the new certificate which created in above step on mobile device: ... Access to browse the Exchange Server 2003 client after you install ...
    (microsoft.public.windows.server.sbs)
  • Re: Need for encryption in WSE 3.0 if using SS-avoid man-in-middle
    ... order to detect we are connected to the wrong server (even though its SSL ... certificate is OK and valid by Verisign); we would need a client certificate. ... this can be detected by SSL/HTTPS client in ...
    (microsoft.public.dotnet.framework.aspnet.security)