Skip to content

Extend backend TLS configuration with cert host and SNI#168

Merged
aturon merged 2 commits into
mainfrom
aturon/tls-options
Aug 17, 2022
Merged

Extend backend TLS configuration with cert host and SNI#168
aturon merged 2 commits into
mainfrom
aturon/tls-options

Conversation

@aturon
Copy link
Copy Markdown
Member

@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
Copy Markdown
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