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 finding proper provided certificate when ACME is enabled #5873

Merged
merged 3 commits into from
Feb 6, 2020

Conversation

yazd
Copy link

@yazd yazd commented Nov 20, 2019

What does this PR do?

Fixes domain to certificate matching when ACME is enabled and non-acme certificates are provided via configuration.

Currently the domain to certificate matching algorithm here fails and the default certificate is served. The result is that if two or more non-ACME certificates are provided, only the first one is used.
HTTPS requests to domains not covered by the default certificate fail.

More

  • Added/updated tests
  • Added/updated documentation

Additional Notes

I am not aware of the project's architecture, or whether the place where I added the call to BuildNameToCertificate is the best place for it.

@yazd
Copy link
Author

yazd commented Dec 1, 2019

To ease review, a.TLSConfig.NameToCertificate is empty here if BuildNameToCertificate (docs) is not called, which means matching will never occur, only the default certificate will be provided.

It is a one-line change.
Can someone review please?

Note: this targets v1.7, I am not sure if the bug exists in v2 or not.

Copy link
Contributor

@dtomcej dtomcej left a comment

Choose a reason for hiding this comment

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

LGTM
:shipit:

Copy link
Member

@juliens juliens left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@ldez ldez left a comment

Choose a reason for hiding this comment

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

LGTM

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

Successfully merging this pull request may close these issues.

None yet

5 participants