nginx-proxy-manager icon indicating copy to clipboard operation
nginx-proxy-manager copied to clipboard

ssl wildcard certificate internal error dns challenge

Open okuzlu opened this issue 3 years ago • 4 comments

Tried to create an ssl certificate with cloudflare dns challenge but I get a internal error.

internal error message on webgui `Error: Command failed: /usr/sbin/nginx -t -g "error_log off;" nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/npm-3/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/npm-3/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file) nginx: configuration file /etc/nginx/nginx.conf test failed

at ChildProcess.exithandler (node:child_process:397:12)
at ChildProcess.emit (node:events:390:28)
at maybeClose (node:internal/child_process:1064:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)`

nginx container log [2/8/2022] [10:48:23 AM] [Express ] › ⚠ warning Command failed: /usr/sbin/nginx -t -g "error_log off;" nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/npm-3/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/npm-3/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file) nginx: configuration file /etc/nginx/nginx.conf test failed

okuzlu avatar Feb 08 '22 10:02 okuzlu

I'm also encountering this error and just came here searching for it. Have you found any way to create a wildcard cert from within the GUI?

jakemauer avatar Aug 03 '22 06:08 jakemauer

I'm also encountering this error and just came here searching for it. Have you found any way to create a wildcard cert from within the GUI?

I deleted the volumes and reinstalled the nginx proxy. After that I was again able to create a cert.

okuzlu avatar Aug 03 '22 08:08 okuzlu

I figured it out, this isn't a bug, it was (at least in my case) due to the Cloudflare "Credentials File Content" being malformed. I had accidentally formatted it as one line and thus it was just a single commented out line like this:

# Cloudflare API token dns_cloudflare_api_token = 0123456789abcdef0123456789abcdef01234567

When it should look like this:

# Cloudflare API token 
dns_cloudflare_api_token = 0123456789abcdef0123456789abcdef01234567

or a single line like this: dns_cloudflare_api_token = 0123456789abcdef0123456789abcdef01234567

jakemauer avatar Aug 04 '22 18:08 jakemauer