Skip to content
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

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

dckorben
Copy link
Contributor

@dckorben dckorben commented Jan 31, 2025

Fixes Issue #895.

Added Tests for Local Certificate with CA

if (string.IsNullOrEmpty(_socketSettings.CACertificatePath)) {
_nonSessionLog.OnEvent("CACertificatePath is not specified");
return false;
Copy link
Contributor Author

@dckorben dckorben Feb 4, 2025

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

Copy link
Contributor Author

@dckorben dckorben Feb 10, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant