Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

self-signed certificates should be installed to traefik/spin #711

Open
bacongobbler opened this issue May 2, 2022 · 0 comments
Open

self-signed certificates should be installed to traefik/spin #711

bacongobbler opened this issue May 2, 2022 · 0 comments
Labels
API Issues or pull requests that affect the API enhancement New feature or request

Comments

@bacongobbler
Copy link
Contributor

Right now we bind the certificate to kestrel's config but do nothing with nomad/Traefik. We only resolve let's encrypt support.

// Add cert to kestrel config; kestrel will automatically reload
// https://docs.microsoft.com/en-us/dotnet/core/compatibility/aspnet-core/5.0/kestrel-configuration-changes-at-run-time-detected-by-default
//
// NOTE: It is safe to assume that a domain has been added thanks to CreateChannelCommandValidator.
//
// TODO: Do we need to handle cases when the domain name changes? Perhaps we should handle that with a new event.
// That being said, it is likely the certificate will need to be replaced... So this may not be an issue.
var sniOptions = new SniOptions(new SniOptions.CertificateOptions(channel.Certificate.PublicKey!, channel.Certificate.PrivateKey!, Path.Combine(System.IO.Directory.GetCurrentDirectory(), channel.Domain)));
_configuration.GetSection($"{SniOptions.Position}:{channel.Domain}").Bind(sniOptions);

""traefik.http.routers." + Id + @".rule=Host(`${var.host}`)"",
" + entrypoint + @"
""traefik.http.routers." + Id + @".tls=true"",
" + certresolver + @"
""traefik.http.routers." + Id + @".tls.domains[0].main=${var.host}""

fermyon/spin#114 introduced tls key/cert support for the spin runtime, so we should be able to install a TLS certificate into the nomad job so that spin is serving the certificate.

@bacongobbler bacongobbler added enhancement New feature or request API Issues or pull requests that affect the API labels May 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API Issues or pull requests that affect the API enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant