Skip to content

unbound: user-defined CAs#10283

Open
sopex wants to merge 1 commit into
opnsense:masterfrom
sopex:blocklist-ca
Open

unbound: user-defined CAs#10283
sopex wants to merge 1 commit into
opnsense:masterfrom
sopex:blocklist-ca

Conversation

@sopex
Copy link
Copy Markdown
Member

@sopex sopex commented May 10, 2026

Important notices

Before you submit a pull request, we ask you kindly to acknowledge the following:

Related issue

Closes: #10281

'stream': True
}
if os.path.exists('/usr/local/etc/ssl/cert.pem'):
req_opts['verify'] = '/usr/local/etc/ssl/cert.pem'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what I don't get is that REQUESTS_CA_BUNDLE should be set:

REQUESTS_CA_BUNDLE=/usr/local/etc/ssl/cert.pem

And this should work for other scripting already.

Copy link
Copy Markdown
Member Author

@sopex sopex May 10, 2026

Choose a reason for hiding this comment

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

requests.get() seems to need a verify argument to include CAs other the ones it is bundled with.
configd doesn't seem up to the task.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

that's pretty weird, I'm quite sure this used to work earlier as also specified in https://requests.readthedocs.io/en/latest/user/advanced/

This list of trusted CAs can also be specified through the REQUESTS_CA_BUNDLE environment variable. I

Copy link
Copy Markdown
Member Author

@sopex sopex May 10, 2026

Choose a reason for hiding this comment

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

When you are using the prepared request flow, keep in mind that it does not take into account the environment. This can cause problems if you are using environment variables to change the behaviour of requests. For example: Self-signed SSL certificates specified in REQUESTS_CA_BUNDLE will not be taken into account. As a result an SSL: CERTIFICATE_VERIFY_FAILED is thrown.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In either case I don't like hardcoding this everywhere it is deemed necessary.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

When you are using the prepared request flow, keep in mind that it does not take into account the environment. This can cause problems if you are using environment variables to change the behaviour of requests. For example: Self-signed SSL certificates specified in REQUESTS_CA_BUNDLE will not be taken into account. As a result an SSL: CERTIFICATE_VERIFY_FAILED is thrown.

sure, but we're not talking about a self-signed cert, but a cert signed by a self created CA, which is basically the same as any other CA in the list, unless we're trying to create a self-signed cert which does not belong to a CA.....

just to be sure, you did try this yourself?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Self signed certs also work when uploading them to Authorities.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I could imagine that to be some sort of difference, but indeed it isn't env and parameter should be the same according the source. Just leaving this here for reference.

https://github.com/psf/requests/blob/e8d2c015eecda8273612dd4562425e00cd164ba5/src/requests/sessions.py#L849-L853

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Upon further reflection, I believe they just tried to manually update the list without engaging configd...
Sorry for the wasted time.
Maybe the button should be renamed to "Apply & Update Blocklists" similarly to how Suricata displays it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@fichtner Is there merit to this, or should we close it?

Maybe the button should be renamed to "Apply & Update Blocklists" similarly to how Suricata rules display it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Unbound DNS Blocklist does not trust user-defined Certificate Authorities

3 participants