Skip to content

Conversation

@temporal-nick
Copy link
Contributor

What was changed

  • Inverted CA verification flag to match InsecureSkipVerify, and to have it default to verifying CA, the more secure option.
  • Bring behavior of the main branch in line with v0.1.13: When ServerName is not provided, client verification should be off. To help improve clarity, the proxy will fail to initialize when CA verification is enabled and servername is also not set.

Why?

Fix local TLS auth for the main branch

@temporal-nick temporal-nick requested a review from a team as a code owner January 15, 2026 21:13
remoteCAPath: ""
caServerName: ""
verifyCA: false
skipCAVerification: true
Copy link
Collaborator

Choose a reason for hiding this comment

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

does it mean customer will need to set skipCAVerification to true now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. In the new config, customers will have to proactively set this to true

if serverConfig.VerifyCA {
tlsConfig.ClientAuth = tls.RequireAndVerifyClientCert
if !serverConfig.SkipCAVerification {
tlsConfig.ClientAuth = tls.RequireAnyClientCert
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is difference between RequireAndVerifyClientCert and RequireAnyClientCert?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

RequireAndVerifyClientCert checks the cert against the local CA chain. We don't need it, because we're already using a certificate allowlist.

if !clientConfig.SkipCAVerification {
if clientConfig.CAServerName == "" || clientConfig.RemoteCAPath == "" {
return nil, errors.New("CAServerName and RemoteCAPath must be set when VerifyCA is true")
return nil, errors.New("CAServerName and RemoteCAPath must be set when SkipCAVerification is true")
Copy link
Collaborator

Choose a reason for hiding this comment

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

SkipCAVerification is false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, yes.

case config.ConnTypeMuxClient, config.ConnTypeMuxServer:
observer := NewReplicationStreamObserver(c.loggers.Get(LogStreamObserver))
grpcServer, err := buildProxyServer(c, c.clusterDefinition.Connection.MuxAddressInfo.TLSConfig, observer.ReportStreamValue, lifetime)
grpcServer, err := buildProxyServer(c, encryption.TLSConfig{}, observer.ReportStreamValue, lifetime)
Copy link
Collaborator

Choose a reason for hiding this comment

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

we are passing an empty encryption.TLSConfig{} here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The internal mux connection is already TLS, so the hosted grpc server should have no TLSConfig set. This accidental repeating of the TLS config is what actually broke main.

func GetServerTLSConfig(serverConfig TLSConfig, logger log.Logger) (tlsConfig *tls.Config, err error) {
func GetServerTLSConfig(name string, serverConfig TLSConfig, logger log.Logger) (tlsConfig *tls.Config, err error) {
if !serverConfig.IsEnabled() {
logger.Info(fmt.Sprintf("TLS disabled for %s", name))
Copy link
Collaborator

Choose a reason for hiding this comment

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

if name just used for logging, can we set a label in logger instead of passing as an input parameter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair point, will update

@temporal-nick temporal-nick merged commit d100c22 into main Jan 16, 2026
5 checks passed
@temporal-nick temporal-nick deleted the nick/authfix branch January 16, 2026 00:37
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.

3 participants