Skip to content

plugins/rest: carry over all of *tls.Config#8476

Open
srenatus wants to merge 1 commit intoopen-policy-agent:mainfrom
srenatus:sr/vypmmunrtsrx
Open

plugins/rest: carry over all of *tls.Config#8476
srenatus wants to merge 1 commit intoopen-policy-agent:mainfrom
srenatus:sr/vypmmunrtsrx

Conversation

@srenatus
Copy link
Copy Markdown
Contributor

@srenatus srenatus commented Apr 2, 2026

  • The tokenTLSConfig is cloned from DefaultTLSConfig(c) (which includes RootCAs) and then InsecureSkipVerify is set explicitly from c.AllowInsecureTLS, since DefaultTLSConfig only sets it when the service URL is https, but the token URL is always https regardless.
  • New test configures a service with tls.ca_cert pointing to the token server's CA cert, without allow_insecure_tls. This directly reproduces the bug report — before the fix, this would fail with x509: certificate signed by unknown authority.
  • Also removes some duplication we had before.

Fixes #8473.

- The tokenTLSConfig is cloned from DefaultTLSConfig(c) (which
includes RootCAs) and then InsecureSkipVerify is set explicitly from
c.AllowInsecureTLS, since DefaultTLSConfig only sets it when the service
URL is https, but the token URL is always https regardless.

- New test configures a service with tls.ca_cert pointing to the token
server's CA cert, without allow_insecure_tls. This directly reproduces
the bug report — before the fix, this would fail with x509: certificate
signed by unknown authority. Also removes some duplication we had
before.

Fixes open-policy-agent#8473.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
@srenatus srenatus changed the title plugins/rest: carry over all of `*tls.Config plugins/rest: carry over all of *tls.Config Apr 2, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 2, 2026

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit 3127a71
🔍 Latest deploy log https://app.netlify.com/projects/openpolicyagent/deploys/69ce18848ea8de0009e30852
😎 Deploy Preview https://deploy-preview-8476--openpolicyagent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 2, 2026

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit 24fd300
🔍 Latest deploy log https://app.netlify.com/projects/openpolicyagent/deploys/69ce189afbc7e900081bb9ee
😎 Deploy Preview https://deploy-preview-8476--openpolicyagent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

Services credentials oauth2 url giving x509 unknown authority error

2 participants