question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add root certificate while generating certificate files

See original GitHub issue

When calling certificateChain.Cert.toPem() or certificateChain.Cert.toPfx() (ie the extension methods from CertificateChainExtensions) an AcmeException with message Can not find issuer ... is thrown, when the trust-anchor for this certificate is not embedded in the library. It works for LE production and staging, because these root certificates are contained in the library, but fails for instance when testing against a local pebble instance.

I agree with @webprofusion-chrisc that embedding all possible root certificates into the library is not the best way to go (like mentioned here ). So I think, there should be another possibility to (reasonable) easily provide the root certificate.

I’m not too familiar with the ACME RFC, but scanning through I couldn’t find a specification on how to obtain the root certificate automatically

  • It is not contained in the certificate chain which is downloaded from the ACME provider. (Only the cert and intermediates are)
  • The up link SHOULD be present when requesting a certificate in DER format, but support for the DER format itself is optional.
  • It might be possible to extract it from the system’s certificate store (like registry in windows, keychain in MacOS …) but that
    • may not be possible on all platforms,
    • requires platform specific code and
    • does not solve the problem, that the root certificate may not even be known to the system

As possible workaround I could provide a PR which allows to provide the root certificate to CertificateChainExtensions.ToPfx() and CertificateChainExtensions.ToPem() (similar to what’s done in the Certes.CLI with the --issuer option already). So anyone using this library with a CA other than LetsEncrypt can at least pre-download the root certificate and include it in the workflow.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
webprofusion-chrisccommented, Nov 24, 2020

Thanks, yes agree that instead of us scraping around for the proper root cert the ACME CA should have an endpoint that serves the public root certs for the chains they support. It looks like this may have become part of pebble but isn’t part of ACME : https://github.com/letsencrypt/pebble/issues/152

0reactions
stale[bot]commented, Jun 16, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installing the trusted root certificate
Launch MMC (mmc.exe). · Choose File > Add/Remove Snap-ins. · Choose Certificates, then choose Add. · Choose My user account. · Choose Add...
Read more >
Generate root CA key and certificate
Create the root CA directory: mkdir -p /root/internalca cd /root/internalca · Generate the private key of the root CA: openssl genrsa -out rootCAKey.pem...
Read more >
How to Create Your Own SSL Certificate Authority for Local ...
#Adding the Root Certificate to Windows 10Link copied · Open the “Microsoft Management Console” by using the Windows + R keyboard combination, ...
Read more >
Installing a root CA certificate in the trust store
Assuming a PEM-formatted root CA certificate is in local-ca.crt , follow the steps below to install it. Note: It is important to have...
Read more >
Install self-generated root certificates
Go to the right tab and click the import button. Select the root certificate as generated by BounCA. Add the certificate and select...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found