Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agoo does not load the full certificate chain into openssl #135

Closed
alistairjevans opened this issue Oct 16, 2024 · 0 comments · Fixed by #136
Closed

Agoo does not load the full certificate chain into openssl #135

alistairjevans opened this issue Oct 16, 2024 · 0 comments · Fixed by #136

Comments

@alistairjevans
Copy link
Contributor

alistairjevans commented Oct 16, 2024

When testing agoo with a LetsEncrypt certificate, openssl verification fails, because only the leaf certificate of the certificate chain was being returned by agoo; the intermediate issuer from LetsEncrypt was not being included, so openssl could not validate all the way to the root of the chain.

Note that not some libraries and browsers that already have the intermediate cached may not fail verification; I saw this particular issue initially in a docker container.

The cause of the bug is pretty simple, server.c loads the certificate using SSL_CTX_use_certificate_file, rather than SSL_CTX_use_certificate_chain_file; OpenSSL guidance (https://docs.openssl.org/3.3/man3/SSL_CTX_use_certificate/#notes) is to always use SSL_CTX_use_certificate_chain_file now to populate the full chain and return it in negotiation. The call will still support PEM files with just a single cert.

I've got a fork with the fix, will raise a PR momentarily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant