I have an client/server solution into which I am trying to shoehorn SslStream. Everything looks good to me(obviously), but whenever my callback to BeginAuthenticateAsClient() is called, I get the message "The remote certificate is invalid according to the validation procedure."
Now, I've checked and re-checked my Personal certificate and the Trusted Root Certificate Authority certificate I used to create the Personal certificate that my server code uses. Both of them show as valid, the Personal certificate has a private key and the Personal cert "points" to the Trusted Root certificate. In my server code I open an X509Store to the LocalMachine store, which is where my certs are located. I find the Personal cert and create a local X509Certificate variable (_certificate = new X509Certificate(foundCert.RawData);) In the callback to BeginAuthenticateAsServer(), my call to EndAuthenticateAsServer(result) succeeds. But on the client side (running on the same PC, I might add), my call to EndAuthenticateAsClient(result) returns the error above.
Can someone who has expertise in this area give me some pointers to things I may have done incorrectly, please?