[GH-ISSUE #1013] Cannot read property '1' of null #852

Closed
opened 2026-02-26 06:34:40 +03:00 by kerem · 3 comments
Owner

Originally created by @fintechestenberg on GitHub (Apr 12, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1013

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image? yes
  • Are you sure you're not using someone else's docker image? yes
  • If having problems with Lets Encrypt, have you made absolutely sure your site is accessible from outside of your network? not relevant

Describe the bug

  • A clear and concise description of what the bug is.
    I have configured certbot module to use a diffrent server, (step-ca) hosted internally.
    When getting the certificate it produces the error "Certificate is not valid (Cannot read property '1' of null)"
    Looking at the log in docker, everything looks good,
  • Congratulations! Your certificate and chain have been saved at:
    /etc/letsencrypt/live/npm-27/fullchain.pem
    Your key file has been saved at:
    /etc/letsencrypt/live/npm-27/privkey.pem
    Your cert will expire on 2021-07-11. To obtain a new or tweaked
    version of this certificate in the future, simply run certbot
    again. To non-interactively renew all of your certificates, run
    "certbot renew"
  • If you like Certbot, please consider supporting our work by:
    Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
    Donating to EFF: https://eff.org/donate-le

But the certificate is not added, looking at detailed view in the browser;
"ValidationError: Certificate is not valid (Cannot read property '1' of null)"
at /app/internal/certificate.js:738:11
at async Promise.all (index 0)

Is the error message which points to this, https://github.com/jc21/nginx-proxy-manager/blob/master/backend/internal/certificate.js#L738
Unfortunatly I do not understand enough about the javascript to understan specifically what is going wrong here.

Either can someone explain what this error means, or if the error text returned can be imporved to provide any info at all?

  • What version of Nginx Proxy Manager is reported on the login page?
    2.8.1
Originally created by @fintechestenberg on GitHub (Apr 12, 2021). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1013 **Checklist** - Have you pulled and found the error with `jc21/nginx-proxy-manager:latest` docker image? yes - Are you sure you're not using someone else's docker image? yes - If having problems with Lets Encrypt, have you made absolutely sure your site is accessible from outside of your network? not relevant **Describe the bug** - A clear and concise description of what the bug is. I have configured certbot module to use a diffrent server, (step-ca) hosted internally. When getting the certificate it produces the error "Certificate is not valid (Cannot read property '1' of null)" Looking at the log in docker, everything looks good, - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/npm-27/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/npm-27/privkey.pem Your cert will expire on 2021-07-11. To obtain a new or tweaked version of this certificate in the future, simply run certbot again. To non-interactively renew *all* of your certificates, run "certbot renew" - If you like Certbot, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-le But the certificate is not added, looking at detailed view in the browser; "ValidationError: Certificate is not valid (Cannot read property '1' of null)" at /app/internal/certificate.js:738:11 at async Promise.all (index 0) Is the error message which points to this, https://github.com/jc21/nginx-proxy-manager/blob/master/backend/internal/certificate.js#L738 Unfortunatly I do not understand enough about the javascript to understan specifically what is going wrong here. Either can someone explain what this error means, or if the error text returned can be imporved to provide any info at all? - What version of Nginx Proxy Manager is reported on the login page? 2.8.1
kerem 2026-02-26 06:34:40 +03:00
  • closed this issue
  • added the
    stale
    bug
    labels
Author
Owner

@thkwag commented on GitHub (Mar 24, 2022):

It fails when subject is empty in fullchain.pem

$ openssl x509 -in  /etc/letsencrypt/live/npm-{id}/fullchain.pem -subject -noout

Just add 'forceCN' parameter to {step-ca-base-dir}/config/ca.json configuration file and renew certificate

	"authority": {
		"provisioners": [
			{
				"type": "ACME",
				"name": "acme",
				"forceCN": true, <---- Just add this line
				"claims": {
					"minTLSCertDuration": "24h",
					"maxTLSCertDuration": "2160h",
					"defaultTLSCertDuration": "2160h"
				}
			}
               ]
	}

forceCN[*] (https://smallstep.com/docs/step-ca/provisioners#star6): force one of the SANs to become the Common Name, if a common name is not provided.

<!-- gh-comment-id:1076988266 --> @thkwag commented on GitHub (Mar 24, 2022): It fails when subject is empty in fullchain.pem ```shell $ openssl x509 -in /etc/letsencrypt/live/npm-{id}/fullchain.pem -subject -noout ```` Just add 'forceCN' parameter to `{step-ca-base-dir}/config/ca.json` configuration file and renew certificate ```json "authority": { "provisioners": [ { "type": "ACME", "name": "acme", "forceCN": true, <---- Just add this line "claims": { "minTLSCertDuration": "24h", "maxTLSCertDuration": "2160h", "defaultTLSCertDuration": "2160h" } } ] } ``` forceCN[*] (https://smallstep.com/docs/step-ca/provisioners#star6): force one of the SANs to become the Common Name, if a common name is not provided.
Author
Owner

@github-actions[bot] commented on GitHub (Mar 14, 2024):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:1996245253 --> @github-actions[bot] commented on GitHub (Mar 14, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@github-actions[bot] commented on GitHub (Apr 25, 2025):

Issue was closed due to inactivity.

<!-- gh-comment-id:2829221206 --> @github-actions[bot] commented on GitHub (Apr 25, 2025): Issue was closed due to inactivity.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#852
No description provided.