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

Add Let's Encrypt R3 intermediate certificate to server #1372

Closed
tobykurien opened this issue Dec 24, 2022 · 12 comments
Closed

Add Let's Encrypt R3 intermediate certificate to server #1372

tobykurien opened this issue Dec 24, 2022 · 12 comments

Comments

@tobykurien
Copy link

Bridgy server is currently failing to connect to sites using Let's Encrypt R3 certificates (I suspect), so I cannot syndicate from my personal website, I get:

{
  "error": "Could not fetch source URL https://tobykurien.com/post-1670753167/"
}

To fix this, on the bridgy server:

@snarfed
Copy link
Owner

snarfed commented Dec 24, 2022

Ruh roh. Thank you for reporting and details, and sorry for the trouble!

Bridgy is serverless, on https://cloud.google.com/appengine/ , so sadly I can't directly control the CA bundles on the host(s). Its outbound HTTP requests use https://requests.readthedocs.io/ though, which I think uses https://github.com/certifi/python-certifi as its trust store instead of the host's? I'll look.

@tobykurien
Copy link
Author

tobykurien commented Dec 24, 2022 via email

@snarfed
Copy link
Owner

snarfed commented Dec 24, 2022

A year is definitely a long time, agreed! I don't plan to start maintaining my own cert bundle though, that's a bridge too far. I'll see what I can come up with.

@snarfed
Copy link
Owner

snarfed commented Dec 24, 2022

Looks like the root cause here is that Mozilla's CA bundle, which certifi is based on, doesn't include R3? That's odd, since Firefox 108 loads https://tobykurien.com/ fine and doesn't complain.

Background:

I may be hitting the limit of my understanding of CA root vs intermediate certs and chains and CA bundles. Open to ideas! Except for maintaining my own bundle. 😎

@tobykurien
Copy link
Author

I did some digging, and this may be related to "AIA fetching" as described here. A possible solution might be to use aia Python package.

@snarfed
Copy link
Owner

snarfed commented Dec 25, 2022

Oops, forgot to hit submit on this yesterday!


@tobykurien one workaround you could try is bundling the ISRG Root X1 R3 (?) cert with your site's certificate. I do that on eg snarfed.org, which lets Bridgy connect to it ok. I expect most other Bridgy users with LE certs currently do the same thing.

$ openssl s_client -connect snarfed.org:443
...
Certificate chain
 0 s:/CN=snarfed.org
   i:/C=US/O=Let's Encrypt/CN=R3
 1 s:/C=US/O=Let's Encrypt/CN=R3
   i:/C=US/O=Internet Security Research Group/CN=ISRG Root X1
 2 s:/C=US/O=Internet Security Research Group/CN=ISRG Root X1
   i:/O=Digital Signature Trust Co./CN=DST Root CA X3

vs.

$ openssl s_client -connect tobykurien.com:443
...
subject=/CN=cloud.tobykurien.com
issuer=/C=US/O=Let's Encrypt/CN=R3

@snarfed
Copy link
Owner

snarfed commented Dec 25, 2022

Re AIA fetching, yes! Thanks for the links, I ended up looking at that yesterday too. It could definitely help here, but just like maintaining my own cert bundle, I'm reluctant to take on something like that in an end user application. Those links also both describe it as a workaround for "missing" intermediate certs, and imply that the ideal answer might be for your server to include R3 (I think?) in its cert chain. From your first link:

It is a common flaw in SSL server configurations to provide an incomplete chain of certificates, often omitting intermediate certificates.

@tobykurien
Copy link
Author

Understandable about not messing about with AIA fetching. Adding the CA to my server worked, so for others having similar issues, use the fullchain.pem. I'm using HAProxy, so I had to concat my cert + Let's encrypt CA + private key (in that order) into my PEM file.

@Quix0r
Copy link

Quix0r commented Aug 13, 2024

Please remember that R3 and its siblings are now outdated certificates. You need R11 intermediate certs instead. And many servers seem to have moved to R11 already. So how can we fix this when my code tries to connect to an LE-encrypted website (R11 for example).

@snarfed
Copy link
Owner

snarfed commented Aug 13, 2024

@Quix0r Sure! The discussion here is almost three years old.

Is your question related to Bridgy? If your code is connecting to an R11 LE encrypted web site, that's unrelated to this issue or project.

@Quix0r
Copy link

Quix0r commented Aug 18, 2024

We then should this to a new discussion. Sorry for hijacking this topic (my script connects to R11-LE encrypted websites).

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

No branches or pull requests

3 participants