Re: SslStream behavior (slow handshake when used in windows services)
- From: "Joe Kaplan" <joseph.e.kaplan@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 19 Jan 2007 08:36:46 -0600
I think the personal store is the wrong place. You should put them in other
people most likely. If you are putting the whole chain in, I'd put the
intermediate CA certs in the intermediate CA certificate store. I assume
the root is already in trusted roots.
The machine store should be fine and apply to all processes on the box,
although I don't know if there are any weird exceptions to this. The
profile for the service account should also work.
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
--
<letibal@xxxxxxxxx> wrote in message
news:1169206520.823861.269080@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Joe/Dominik,
I have found a workaround to my problem.
I still don't know what is really happening there :
****************
System.Net Information: 0 : [2460] SecureChannel#4032828 - Remote
certificate has errors:
System.Net Information: 0 : [2460] SecureChannel#4032828 - Unknown
error.
System.Net Information: 0 : [2460] SecureChannel#4032828 - Remote
certificate was verified as valid by the user.
*****************
However I know it has something to do with the server-side certificate
validation.
For some reason, it seems that it fails to validate the cert chain (?)
or takes ages to retrieve it and does not succeed ... but still does
not log any error/warning apart from this unknown error.
So If I store the server side cert into the certificate store of the
user account of the user that runs the Windows Service, the problem
dissapears !
One last problem though ! I have tried the exact same piece of code,
but instead of putting it on a win app or on a windows service, I have
put it on an ASP.NET web service. (a client triggers the web service
which in turns attempt to remotely connect using SSL to a web server)
Since I encountered the exact same problem, I tried to store the server
side cert into the correct certificate store.
Using the Microsoft Management console (snap in 'Certificate'), I
stored this cert in the 'Personal' directory of the snap in for :
- a Computer account -- did not make any change
- a Service Account -- (I tried W3WP and ASP.NET) -- did not make any
change
Questions :
- Does this approach make sense ?
- Which windows service do you think I should consider ? (i.e. which
one carries out the SSL handshake when this handshake is initiated by
an ASP.NET web service)
Thanks for your help,
Tibo
Dominick Baier wrote:
you can turn tracing on at System.Net level - maybe this is helpful
http://www.leastprivilege.com/TracingSystemNet.aspx
-----
Dominick Baier (http://www.leastprivilege.com)
I don't know how to get more logging on the unknown error (sorry!),
but I think you are definitely on to something.
However, I can't tell from the trace below if the system account is
checking the CRL and that is what it doesn't like or if there is just
something wrong with the chain itself.
You might consider writing some diagnostics code using
System.Security.Cryptography.X509Certificates and using the new
X509Chain class to check the status while playing around with various
policies. I'm not sure exactly how to stitch all that together right
off the top of my head, but it gives you granular control over how the
chain is verified, so you might be able to figure it out that way.
I wish I had a magic bullet for you.
Joe K.
.
- Follow-Ups:
- References:
- Re: SslStream behavior (slow handshake when used in windows services)
- From: Joe Kaplan
- Re: SslStream behavior (slow handshake when used in windows services)
- From: Dominick Baier
- Re: SslStream behavior (slow handshake when used in windows services)
- From: letibal
- Re: SslStream behavior (slow handshake when used in windows services)
- Prev by Date: Re: SslStream behavior (slow handshake when used in windows services)
- Next by Date: Minimum security requirement for Smart Client
- Previous by thread: Re: SslStream behavior (slow handshake when used in windows services)
- Next by thread: Re: SslStream behavior (slow handshake when used in windows services)
- Index(es):
Relevant Pages
|
Loading