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

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 join this conversation on GitHub. Already have an account? Sign in to comment
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