Nginx +acme+letsencrypt Unable to get local issuer certificate

Hello. domain was indicated for the purpose of an example.

My system FreeBSD 13.1
Soft versions:
nginx/1.22.0 v3.0.4

I will get a certificate. --issue -d -d -w /usr/local/www/cert --server letsencrypt

Certificates are created.

[Wed Oct 12 16:54:54 +03 2022] Your cert is in: /var/db/acme/certs/
[Wed Oct 12 16:54:54 +03 2022] Your cert key is in: /var/db/acme/certs/
[Wed Oct 12 16:54:54 +03 2022] The intermediate CA cert is in: /var/db/acme/certs/
[Wed Oct 12 16:54:54 +03 2022] And the full chain certs is there: /var/db/acme/certs/

I install certificates in nginx. --install-cert -d --cert-file /etc/nginx/ --key-file /etc/nginx/ --fullchain-file /etc/nginx/
[Wed Oct 12 17:03:46 +03 2022] Installing cert to: /etc/nginx/
[Wed Oct 12 17:03:46 +03 2022] Installing key to: /etc/nginx/
[Wed Oct 12 17:03:46 +03 2022] Installing full chain to: /etc/nginx/

nginx vitrhost

ssl_certificate /etc/nginx/;
ssl_certificate_key /etc/nginx/;
ssl_trusted_certificate /etc/nginx/;
ssl_dhparam /usr/local/etc/nginx/dhparam.pem;

I check the certificate and see an error.
Unable to get local issuer certificate. The site certificate or intermediate certificates may not have been installed correctly.

How to fix?

How did you do that exactly? Which command et cetera?


Checked here.

1 Like

#### Unable to get local issuer certificate. Most likely, the certificate or certificate chain is not installed correctly.

Here is more detailed information on verification.

It says there's a GlobalSign certificate installed for

3 Likes indicated just as an example, I don’t want to show my domain.

That directive doesn't do what you think it does.

You can keep the dhparams if you want them, but the other three lines should become these two:

ssl_certificate /etc/nginx/;
ssl_certificate_key /etc/nginx/;


Not understood.
do I need to use this option with acme issued certificates?
ssl_trusted_certificate /etc/nginx/;


You should use

  • ssl_certificate
  • ssl_certificate_key

Where ssl_certificate points to fullchain.pem and ssl_certificate_key points to the private key.

You should not use ssl_trusted_certificate unless you have a very good reason to. And even then, it's not used to send your certificate, it's to tell nginx what to trust when validating ocsp responses.

As for ssl_dhparam you can pretty much do whatever you want.


Without your actual domain name, it's nearly impossible to help you quickly and accurate to an extend that it's actually mandatory to provide it to get help to begin with, as stated in the initial questionnaire of the #help section.


you need to configure the cert/key files in your side conf of nginx.

1 Like

side conf of nginx?

maybe "site" ?

1 Like

Almost certainly "site config". does not have webserver installers like Certbot does, so the user needs to manually add the certificate/key to the webservers configuration.


you're right.

ssl_certificate /etc/nginx/;
ssl_certificate_key /etc/nginx/;

It remains to understand how to properly renew certificates.

sorry, typo: site

1 Like --install-cert -d --cert-file /etc/nginx/ --key-file /etc/nginx/ --fullchain-file /etc/nginx/ \
--reload-cmd  "service nginx reload"
2 Likes should have automated the renewals on install.
Check the cron jobs:
crontab -l

There should be a line with times and:
"/root/"/ --cron --home "/root/" > /dev/null


I thought, is it right?
I am using ssl_stapling.

ssl_certificate /etc/nginx/;
ssl_certificate_key /etc/nginx/;
#ssl_trusted_certificate /etc/nginx/;
ssl_dhparam /usr/local/etc/nginx/dhparam.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers off;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;
resolver_timeout 3s;

Do me need to validate the chains of trust of the OCSP response using the root CA and intermediate certificates?

No, you don't need to use ssl_trusted_certificate.