feat(server): separate HTTPS from mTLS authentication#1351
Open
sjenning wants to merge 1 commit into
Open
Conversation
17b1e9c to
6793737
Compare
TaylorMutch
reviewed
May 13, 2026
6793737 to
96e496b
Compare
|
Label |
Collaborator
|
/ok to test 96e496b |
59d4465 to
df32568
Compare
sjenning
commented
May 14, 2026
| .push(DnType::CommonName, "openshell-client"); | ||
| client_params | ||
| .distinguished_name | ||
| .push(DnType::OrganizationalUnitName, "openshell-user"); |
Contributor
Author
There was a problem hiding this comment.
@TaylorMutch I was hoping to make this change fully backward compatible but the mTLS client cert for the supervisor needs to have a role now to get through authz.
Make --tls-client-ca optional and make client certificates always optional when a CA is configured. This decouples HTTPS encryption from mTLS authentication, allowing mTLS and OIDC bearer tokens to coexist as parallel authentication mechanisms. When --tls-client-ca is provided, client certificates are validated against the CA when presented but never required. Clients may connect with or without a certificate — authentication is handled at the application layer (e.g. OIDC). Two TLS modes are now supported: - HTTPS with optional mTLS (--tls-client-ca provided) - HTTPS-only (--tls-client-ca omitted) The --disable-gateway-auth flag is preserved for backward compatibility but is now a no-op. The allow_unauthenticated field has been removed from TlsConfig. The Helm chart conditionally includes the client-ca volume and env var based on whether clientCaSecretName is configured.
df32568 to
6e76f6d
Compare
Collaborator
|
/ok to test 6e76f6d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--tls-client-caoptionalRelated Issue
N/A
Changes
Core config
openshell-core/config.rs:TlsConfig.client_ca_pathchanged fromPathBuftoOption<PathBuf>;allow_unauthenticatedreplaced withrequire_client_auth(inverted semantics)TLS layer
openshell-server/tls.rs:TlsAcceptor::from_filestakesOption<&Path>for client CA —Somebuilds a client cert verifier (optional or required),Noneuseswith_no_client_auth()Authentication routing
openshell-server/multiplex.rs: Newserve_with_peer_identity()plumbs the mTLSIdentityfrom the TLS handshake into the gRPC auth layer;AuthGrpcRouterfalls back to mTLS identity when no bearer token is present and a client cert was presented; newextract_peer_identity()parses CN and OU fields from the peer's X.509 certificateopenshell-server/lib.rs: Connection handler callsextract_peer_identity()on the TLS stream and passes it toserve_with_peer_identity()CLI / startup
openshell-server/cli.rs:--tls-client-cais no longer required when TLS is enabled;--disable-gateway-authflag removed; added mutual exclusion check (--disable-tls+--tls-client-ca); startup logs now distinguish HTTPS, mTLS, OIDC, and no-auth statesopenshell-server/Cargo.toml: Addedx509-parserdependency for peer cert extractionHelm
deploy/helm/openshell/templates/statefulset.yaml: Conditionally include client-ca env var, volume mount, and volume only whenclientCaSecretNameis setdeploy/helm/openshell/values.yaml: Document thatclientCaSecretNameis optionalDocs / config references
deploy/man/openshell-gateway.8.md: Updated man page —--tls-client-camarked optional,--disable-gateway-authremoveddeploy/man/openshell-gateway.env.5.md:OPENSHELL_TLS_CLIENT_CAmarked optional,OPENSHELL_DISABLE_GATEWAY_AUTHremoveddeploy/rpm/CONFIGURATION.md: Same updates for RPM config docsdeploy/kube/manifests/openshell-helmchart.yaml: RemoveddisableGatewayAuthfieldTests
edge_tunnel_auth.rs: Rewritten — oldallow_unauthenticatedmatrix replaced with new model: valid cert accepted, no cert accepted (optional), bearer auth passthrough, rogue cert rejected, and new HTTPS-only mode testmultiplex_tls_integration.rs: Updatedfrom_filescalls to newOption<&Path>signature; added HTTPS-only (no client CA) test caseTesting
mise run pre-commitpassesedge_tunnel_authtests pass (rewritten test matrix)multiplex_tls_integrationtests pass (including new HTTPS-only case)--tls-certand--tls-keyonly, verify HTTPS-only mode works with OIDCChecklist
--tls-client-causers (certs are now optional instead of required — strictly more permissive)--disable-gateway-authremoved,allow_unauthenticatedconfig field removed