Skip to content

CSHARP-1000 Fix support for astra custom domain #600

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

Merged
merged 4 commits into from
Nov 7, 2023

Conversation

joao-r-reis
Copy link
Collaborator

No description provided.

@joao-r-reis joao-r-reis added the bug label Nov 7, 2023
@joao-r-reis joao-r-reis added this to the 3.19.4 milestone Nov 7, 2023
@joao-r-reis joao-r-reis self-assigned this Nov 7, 2023
Copy link
Collaborator

@absurdfarce absurdfarce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Certainly seems to address the problem as described. A few nits based on my understanding of the code but I don't think either of them are problematic enough to hold things up if you need to get a release out.

It might be nice to have a test to confirm that SANs were being used for validation but, again, I don't think it's essential.

var result = new List<string>();

var subjectAlternativeName = cert.Extensions.Cast<X509Extension>()
.Where(n => n.Oid.Value == "2.5.29.17") //n.Oid.FriendlyName=="Subject Alternative Name")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps use the SubjectAlternateNameOid constant. you defined above here instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh I had to try multiple solutions and forgot about those constants... fixed


foreach (var alternativeName in alternativeNames)
{
var groups = Regex.Match(alternativeName, @"^(.*)=(.*)").Groups; // @"^DNS Name=(.*)").Groups;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intended to... replace the DnsNameRegex referenced above? Seems like it's trying to do the same thing with a different regex.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh I had to try multiple solutions and forgot about those constants... fixed

@absurdfarce
Copy link
Collaborator

👍 to the most recent round of changes. Nice tests @joao-r-reis !

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

Successfully merging this pull request may close these issues.

2 participants