-
Notifications
You must be signed in to change notification settings - Fork 564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix If CACertificatePath Is Empty, Verification Fails #932
base: master
Are you sure you want to change the base?
Conversation
if (string.IsNullOrEmpty(_socketSettings.CACertificatePath)) { | ||
_nonSessionLog.OnEvent("CACertificatePath is not specified"); | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the root of the problem. SslStream provides public certificate validation via SslPolicyErrors before we get here. This return false
causes this function to fail for all public certificates. Instead, we should validate SslPolicyErrors for both public and private certs.
Why this behavior changed from older versions is what I haven't figured out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic ended up being changed by #827. It appears unintentional.
I'm surprised more people haven't run into this because with the change in logic you'll get AuthenticationException
"The remote certificate was rejected by the provided RemoteCertificateValidationCallback
" throw.
Fixes Issue #895.
Added Tests for Local Certificate with CA