Suppose I want to do host-based-security similar to HTTPS. What is the canonical validation code to verify that the server certificate matches the hostname and the certificate chain is valid when I open my SslStream connection?
Asked
Active
Viewed 62 times
0
-
Ok I found the answer.... It's a bit 'duh'. Someone want to post before I do? :) – Tim Lovell-Smith Apr 27 '15 at 19:57
1 Answers
0
Yes it's just too easy (RTFD@me!). Let the framework do all that tricky authentication for you:
await sslStream.AuthenticateAsClientAsync(hostname);

Tim Lovell-Smith
- 15,310
- 14
- 76
- 93