AH02572: Failed to configure at least one certificate and key

Hi, I'm using acme.sh to create a certificate for an apache server on fedora35 and have received an odd error message after replacing the current cert created with certbot with this one.

AH02572: Failed to configure at least one certificate and key for arcade.example.com:443
SSL Library Error: error:140A80B1:SSL routines:SSL_CTX_check_private_key:no certificate assigned

This is a drop-in replacement for a cert that was created by certbot and working just fine with this same apache config.

The command I have run is the following. It's using the dns_cf plugin. I've excluded the CF_Account_ID and CF_Email variables, but it did result in a valid cert. I've also verified it with openssl to be sure it contains the same name as I am installing.

./acme.sh --log --issue --dns dns_cf -d arcade.example.com

Here is my apache config. Outside the virtual host I have the following:

# modern configuration, tweak to your needs
SSLProtocol             all -SSLv3 -TLSv1 -TLSv1.1
SSLHonorCipherOrder     on
SSLCompression          off
SSLSessionTickets       off

# OCSP Stapling, only in httpd 2.3.3 and later
SSLUseStapling          on
SSLStaplingResponderTimeout 5
SSLStaplingReturnResponderErrors off
SSLStaplingCache        shmcb:/var/run/ocsp(128000)

Inside the virtual host I have the following:

  SSLEngine on
  SSLCertificateKeyFile /etc/letsencrypt/privkey.pem
  SSLCertificateChainFile /etc/letsencrypt/fullchain.pem

The fullchain.pem is the fullchain.cer file generated by acme.sh and privkey.pem is arcade.example.com.key.

I'm not sure what more info I can provide to troubleshoot this. I've done quite a bit of experimenting and reading, but haven't really found any tips on how to fix it.

I'd compare the files to ensure they are good copies and also the access set on them.

If you are using acme.sh and Apache, why are you storing the certs in /etc/letsencrypt ?
[can't Apache just use the default acme.sh cert location?]


The certs are normally created on an internal host then scp'd to all remote hosts.

Many are used just for postfix, so there's not always a virtual host or web domain associated with the hostname to be able to always use web auth, so I'm instead using dns only.

In this example, I created a cert specifically for this host to not only attempt to show it wasn't a problem with the cert, but also to make it easier to explain here.

The files are owned by root, group apache. The path is just historical convention for me, since it used to be generated using certbot.


Those are not the correct lines to setup HTTPS. The correct settings depend on your Apache version. Regardless of version, KeyFile with ChainFile is not an accurate combination.

See this post


Ugh, that was it, thanks. This host was somehow different than all the rest and overlooked it.

It should be:

SSLEngine on
SSLCertificateKeyFile /etc/letsencrypt/privkey.pem
SSLCertificateFile /etc/letsencrypt/fullchain.pem


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.