Wrong order in the Fullchain (For Nginx) #7

Closed
opened 2025-12-29 00:21:43 +01:00 by adam · 0 comments
Owner

Originally created by @musab1 on GitHub (Dec 8, 2015).

Hi

When creating the fullchain.pem the order is wrong.

You are creating ChainCert -> Domain Cert instead the other way around.
Nginx is Failing with:
failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch)
as the privkey.pem doenst match the first found certificate.

As i have no Idea about Pull Requests, here the diff which fix this:

diff letsencrypt.sh letsencrypt.sh.orig 
211d210
<     cat "${BASEDIR}/certs/${domain}/cert-${timestamp}.pem" > "${BASEDIR}/certs/${domain}/fullchain-${timestamp}.pem"
213c212
<       cat "${BASEDIR}/certs/${ROOTCERT}" >> "${BASEDIR}/certs/${domain}/fullchain-${timestamp}.pem"

---
>       cat "${BASEDIR}/certs/${ROOTCERT}" > "${BASEDIR}/certs/${domain}/fullchain-${timestamp}.pem"
215c214
<       cat "${SCRIPTDIR}/certs/${ROOTCERT}" >> "${BASEDIR}/certs/${domain}/fullchain-${timestamp}.pem"

---
>       cat "${SCRIPTDIR}/certs/${ROOTCERT}" > "${BASEDIR}/certs/${domain}/fullchain-${timestamp}.pem"
216a216
>     cat "${BASEDIR}/certs/${domain}/cert-${timestamp}.pem" >> "${BASEDIR}/certs/${domain}/fullchain-${timestamp}.pem"

thank you, great client by the way.

Originally created by @musab1 on GitHub (Dec 8, 2015). Hi When creating the fullchain.pem the order is wrong. You are creating ChainCert -> Domain Cert instead the other way around. Nginx is Failing with: failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch) as the privkey.pem doenst match the first found certificate. As i have no Idea about Pull Requests, here the diff which fix this: <pre> diff letsencrypt.sh letsencrypt.sh.orig 211d210 < cat "${BASEDIR}/certs/${domain}/cert-${timestamp}.pem" > "${BASEDIR}/certs/${domain}/fullchain-${timestamp}.pem" 213c212 < cat "${BASEDIR}/certs/${ROOTCERT}" >> "${BASEDIR}/certs/${domain}/fullchain-${timestamp}.pem" --- > cat "${BASEDIR}/certs/${ROOTCERT}" > "${BASEDIR}/certs/${domain}/fullchain-${timestamp}.pem" 215c214 < cat "${SCRIPTDIR}/certs/${ROOTCERT}" >> "${BASEDIR}/certs/${domain}/fullchain-${timestamp}.pem" --- > cat "${SCRIPTDIR}/certs/${ROOTCERT}" > "${BASEDIR}/certs/${domain}/fullchain-${timestamp}.pem" 216a216 > cat "${BASEDIR}/certs/${domain}/cert-${timestamp}.pem" >> "${BASEDIR}/certs/${domain}/fullchain-${timestamp}.pem" </pre> thank you, great client by the way.
adam closed this issue 2025-12-29 00:21:43 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dehydrated#7