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

Extend backend TLS configuration with cert host and SNI #168

Merged
merged 2 commits into from
Aug 17, 2022

Conversation

aturon
Copy link
Contributor

@aturon aturon commented Aug 16, 2022

To get closer to parity with C@E backend configuration, we add the ability to specify a certificate hostname, distinct from both the host URI or any override host. In addition, backends can now specify whether to use SNI or not; if they do, and the cert hostname is present, it will be used for SNI.

That is slightly less flexible than C@E, which allows distinct SNI and cert hosts. That's not currently possible with the TLS implementation we're using in Viceroy, and the C@E customization is mostly used to disable SNI, which we provide here using a dedicated flag.

The new backend settings are:

  • cert_host to specify the hostname for certificate checking (and SNI, if enabled)
  • use_sni, a boolean specifying whether to employ SNI for the backend.

Both settings are optional. If cert_host is not specified, the host from the backend URI is used instead. If use_sni is not specified, SNI is enabled by default.

Note: this PR does not include tests, which would require quite a bit of scaffolding to do properly. I have, however, tested locally using a real fastly.toml provided by a customer, which requires cert_host specification to properly reach the backend.

To get closer to parity with C@E backend configuration, we add the ability to specify a certificate hostname, distinct from both the host URI or any override host. In addition, backends can now specify whether to use SNI or not; if they do, and the cert hostname is present, it will be used for SNI.

That is slightly less flexible than C@E, which allows distinct SNI and cert hosts. That's not currently possible with the TLS implementation we're using in Viceroy, and the C@E customization is mostly used to _disable_ SNI, which we provide here using a dedicated flag.

The new backend settings are:

* `cert_host` to specify the hostname for certificate checking (and SNI, if enabled)
* `use_sni`, a boolean specifying whether to employ SNI for the backend.

Both settings are optional. If `cert_host` is not specified, the host from the backend URI is used instead. If `use_sni` is not specified, SNI is enabled by default.
@aturon aturon requested a review from acw August 16, 2022 21:00
Copy link
Contributor

@acw acw left a comment

Choose a reason for hiding this comment

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

❇️

@aturon aturon merged commit 31fdaee into main Aug 17, 2022
@aturon aturon deleted the aturon/tls-options branch August 17, 2022 16:17
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.

2 participants