Skip to content

Allow client TLS to verify server with system root CAs#235

Merged
hehaifengcn merged 1 commit into
mainfrom
haifengh/client-ca
Jun 4, 2026
Merged

Allow client TLS to verify server with system root CAs#235
hehaifengcn merged 1 commit into
mainfrom
haifengh/client-ca

Conversation

@hehaifengcn

@hehaifengcn hehaifengcn commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

GetClientTLSConfig previously required RemoteCAPath whenever
SkipCAVerification was false, forcing every client to ship a CA bundle
even when the server cert chains to a public CA (e.g. Let's Encrypt).
Now only CAServerName is required; if RemoteCAPath is empty, RootCAs
stays nil and Go's TLS stack falls back to x509.SystemCertPool. Also
update IsEnabled to recognize CAServerName-only configs as enabled.

Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com

What was changed

Why?

Checklist

  1. Closes

  2. How was this tested:

Test agains eu-central-1-internal.a2dd6.tmprl.cloud:8233

client tls config with skipCAVerification = false (enable server verfication)

TLS connection pass when caServerName is set to

<any>.a2dd6.tmprl.cloud
*.a2dd6.tmprl.cloud
a2dd6.tmprl.cloud

TLS connection failed when caServerName is set to

other.tmprl.cloud
  1. Any docs updates needed?

GetClientTLSConfig previously required RemoteCAPath whenever
SkipCAVerification was false, forcing every client to ship a CA bundle
even when the server cert chains to a public CA (e.g. Let's Encrypt).
Now only CAServerName is required; if RemoteCAPath is empty, RootCAs
stays nil and Go's TLS stack falls back to x509.SystemCertPool. Also
update IsEnabled to recognize CAServerName-only configs as enabled.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@hehaifengcn hehaifengcn requested a review from a team as a code owner June 4, 2026 20:24

@liam-lowe liam-lowe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes seem fine.

nit: existing test coverage doesn't seem comprehensive. I don't think there are tests for Server (only Test_ClientTLSConfig) - and the actual test doesn't actually validate anything useful.

I think there will be some failure modes existing (or introduced) due to this lack of coverage.

Comment thread encryption/tls_test.go
func (s *tlsTestSuite) AfterTest(suiteName, testName string) {
}

func (s *tlsTestSuite) Test_ClientTLSConfig() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need server tests as well - I imagine this impacts both sides?

@hehaifengcn hehaifengcn merged commit dce4a0e into main Jun 4, 2026
5 checks passed
@hehaifengcn hehaifengcn deleted the haifengh/client-ca branch June 4, 2026 21:04
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