I am trying to use the .Net class System.Security.SslStream to process the server side of an SSL / TLS stream with client authentication.
To do a handshake, I use this code:
SslStream sslStream = new SslStream(innerStream, false, RemoteCertificateValidation, LocalCertificateSelectionCallback); sslStream.AuthenticateAsServer(serverCertificate, true, SslProtocols.Default, false);
Unfortunately, this causes SslStream to send a CertificateRequest containing the subject names of all certificates in my trusted CryptoAPI root store.
I would like to be able to override this. I do not need to require the user to install or remove certificates from the Trusted Root Store.
It seems that SslStream uses the SSPI / SecureChannel at the bottom, so if someone knows how to make an equivalent with this API, this will be useful too.
Any ideas?
source share