Skip to content

feat: multiple TLS configuration improvements#27162

Merged
gwossum merged 4 commits intomaster-1.xfrom
gw/tls_config_improvements
Jan 28, 2026
Merged

feat: multiple TLS configuration improvements#27162
gwossum merged 4 commits intomaster-1.xfrom
gw/tls_config_improvements

Conversation

@gwossum
Copy link
Copy Markdown
Member

@gwossum gwossum commented Jan 27, 2026

Externally visible changes:

  • New [http] https-insecure-certificate configuration allows skipping permission checking for HTTP TLS certificate.
  • New [opentsdb] insecure-certificate configuration allows skipping permission checking for OpenTSDB endpoint certificates.

Internal changes:

  • TLSConfigManager
    • Allow skipping certificate permission checks with WithIgnoreFilePermissions
    • Direct passthrough of TLSCertLoader options suported.
    • Add support for client authentication using WithClientAuth
    • Custom root CAs supported through WithRootCAIncludeSystem and WithRootCAFiles
    • Custom client CAs supported through WithClientCAIncludeSystem and WithClientCAFiles
    • Refactoring of construction code
    • NewClientTLSManager now returns an error
  • TLSCertLoader
    • GetClientCertificate: Improve client and server side error messages when the server will not accept the client certificate
    • GetClientCertificate: error message improvement
    • NewTLSCertLoader no longer waits for certificate monitoring goroutine to start before returning. Test code that needs to wait for this should use TLSCertLoader.WaitForMonitorStart.
    • TLSCertLoaderOpt constructors include TLSCertLoader in their name

Externally visible changes:
- New `[http] insecure-certificate` configuration allows skipping permission
checking for HTTP TLS certificate.
- New `[opentsdb] insecure-certificate` configuration allows skipping
permission checking for OpenTSDB endpoint certificates.

Internal changes:
- TLSConfigManager
  - Allow skipping certificate permission checks with WithIgnoreFilePermissions
  - Direct passthrough of TLSCertLoader options suported.
  - Add support for client authentication using WithClientAuth
  - Custom root CAs supported through WithRootCAIncludeSystem and
    WithRootCAFiles
  - Custom client CAs supported through WithClientCAIncludeSystem and
    WithClientCAFiles
  - Refactoring of construction code
  - NewClientTLSManager now returns an error
- TLSCertLoader
  - GetClientCertificate: Improve client and server side error messages
    when the server will not accept the client certificate
  - GetClientCertificate: error message improvement
  - NewTLSCertLoader no longer waits for certificate monitoring goroutine
    to start before returning. Test code that needs to wait for this should
    use TLSCertLoader.WaitForMonitorStart.
  - TLSCertLoaderOpt constructors include TLSCertLoader in their name
@devanbenz
Copy link
Copy Markdown

[http] insecure-certificate configuration allows skipping permission checking for HTTP TLS certificate.
[opentsdb] insecure-certificate configuration allows skipping permission checking for OpenTSDB endpoint certificates.

Can you please add these to config.sample.toml?

Copy link
Copy Markdown

@devanbenz devanbenz left a comment

Choose a reason for hiding this comment

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

One comment about the new configuration items.

@gwossum
Copy link
Copy Markdown
Member Author

gwossum commented Jan 28, 2026

[http] insecure-certificate configuration allows skipping permission checking for HTTP TLS certificate.
[opentsdb] insecure-certificate configuration allows skipping permission checking for OpenTSDB endpoint certificates.

Can you please add these to config.sample.toml?

Good catch!

Copy link
Copy Markdown

@devanbenz devanbenz left a comment

Choose a reason for hiding this comment

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

LGTM

@gwossum gwossum merged commit 85353b3 into master-1.x Jan 28, 2026
10 checks passed
@gwossum gwossum deleted the gw/tls_config_improvements branch January 28, 2026 22:41
gwossum added a commit that referenced this pull request Feb 12, 2026
* feat: multiple TLS configuration improvements

Externally visible changes:
- New `[http] https-insecure-certificate` configuration allows skipping permission
checking for HTTP TLS certificate.
- New `[opentsdb] insecure-certificate` configuration allows skipping
permission checking for OpenTSDB endpoint certificates.

Internal changes:
- TLSConfigManager
  - Allow skipping certificate permission checks with WithIgnoreFilePermissions
  - Direct passthrough of TLSCertLoader options suported.
  - Add support for client authentication using WithClientAuth
  - Custom root CAs supported through WithRootCAIncludeSystem and
    WithRootCAFiles
  - Custom client CAs supported through WithClientCAIncludeSystem and
    WithClientCAFiles
  - Refactoring of construction code
  - NewClientTLSManager now returns an error
- TLSCertLoader
  - GetClientCertificate: Improve client and server side error messages
    when the server will not accept the client certificate
  - GetClientCertificate: error message improvement
  - NewTLSCertLoader no longer waits for certificate monitoring goroutine
    to start before returning. Test code that needs to wait for this should
    use TLSCertLoader.WaitForMonitorStart.
  - TLSCertLoaderOpt constructors include TLSCertLoader in their name

(cherry picked from commit 85353b3)
gwossum added a commit that referenced this pull request Feb 12, 2026
Add `tlsconfig.TLSConfigManager` for managing TLS configurations, handling certificate reloads, logging certificate expiration warnings, etc.

This is backport of the following master-1.x PRs to the 1.12 branch:
- #27100: feat: add TLSConfigManager for managing TLS configuration (clean cherry-pick)
- #27103: feat: add TLSConfigManager.DialWithDialer method (clean cherry-pick)
- #27106: feat: add NewClientTLSConfigManager and NewDisabledTLSConfigManager  (clean cherry-pick)
- #27120: feat: add TLSConfigManager.UseTLS (clean cherry-pick)
- #27150: fix: Clone *tls.Config returned by TLSConfigManager.TLSConfig (clean cherry-pick)
- #27162: feat: multiple TLS configuration improvements  (almost clean cherry-pick)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants