-
Notifications
You must be signed in to change notification settings - Fork 706
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
Add TLS support to the pinniped-proxy directly. #4951
Conversation
Signed-off-by: Michael Nelson <minelson@vmware.com>
✅ Deploy Preview for kubeapps-dev canceled.
|
Signed-off-by: Michael Nelson <minelson@vmware.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Thank for the explanation!
cmd/pinniped-proxy/src/tls_config.rs
Outdated
// Copyright 2020-2022 the Kubeapps contributors. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
use tokio_native_tls::native_tls::{Identity, TlsAcceptor}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Copyright 2020-2022 the Kubeapps contributors. | |
// SPDX-License-Identifier: Apache-2.0 | |
use tokio_native_tls::native_tls::{Identity, TlsAcceptor}; | |
// Copyright 2022 the Kubeapps contributors. | |
// SPDX-License-Identifier: Apache-2.0 | |
use tokio_native_tls::native_tls::{Identity, TlsAcceptor}; |
let server = Server::bind(&addr).serve(make_svc); | ||
|
||
info!("Listening on http://{}", addr); | ||
let with_tls = opt.proxy_tls_cert != "" && opt.proxy_tls_cert_key != ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe worth adding a warning if just one of them is set ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even erroring and stopping - we can't run with just one.
cmd/pinniped-proxy/src/main.rs
Outdated
|
||
// Run the server for ever. If it returns with an error, return the | ||
// result, otherwise, if it completes, we return Ok. | ||
server.await?; | ||
if with_tls { | ||
info!("Configuring with TLS cert {} and key {}", opt.proxy_tls_cert, opt.proxy_tls_cert_key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is logging the secret name but not the content, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, they're just file paths. Not so clear from the option names...
Signed-off-by: Michael Nelson <minelson@vmware.com>
Signed-off-by: Michael Nelson minelson@vmware.com
Description of the change
After playing around with different options, this appears to be the simplest way to add tls support to pinniped-proxy without breaking the existing non-tls setup.
I'm leaving this as a draft until I figure out how TLS on the related service will interact with this. After that, it should just be updating the api server to be able to trust the cert, then the related chart changes.
Benefits
Possible drawbacks
Applicable issues
Additional information