mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 09:25:55 +03:00
[GH-ISSUE #3862] NPM is not parsing CN from custom certificate correctly #2536
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#2536
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MarcoWel on GitHub (Jul 8, 2024).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/3862
getCertificateInfoFromFile() function does not parse cert subject correctly.
github.com/NginxProxyManager/nginx-proxy-manager@63d06da8a8/backend/internal/certificate.js (L734)It expects the CN as first item (by reading
match[1]), which is not always the case.Example:
openssl x509 -in cert.crt -subject -nooutOutput:
subject=C = DE, ST = State, L = City, O = MyOrg, OU = -, CN = *.example.comWhen loading such a certificate in NPM it seems to work, but accessing the Proxy leads to a ERR_SSL_UNRECOGNIZED_NAME_ALERT error in the browser.
Fix: Make subject parsing regex more robust.
This one should be working:
@MarcoWel commented on GitHub (Jul 8, 2024):
Alternative Solution:
Add
-nameopt RFC2253parameter to this line:github.com/NginxProxyManager/nginx-proxy-manager@63d06da8a8/backend/internal/certificate.js (L731)Result:
This ensures the standardized order of the subject fields where CN is always the first in order.
@SirWobbyTheFirst commented on GitHub (Aug 19, 2024):
Hi @MarcoWel,
Could this expain why my Exchange Server has just started popping up an ERR_SSL_UNRECOGNIZED _NAME_ALERT error message recently? It's proxied through NPM and has only recently started doing it today.
@SteveBattista commented on GitHub (Jan 8, 2025):
You cant use the RFC2253 option as the regex's work with spaces not commas. I have tried a bunch of REGEX This should work but it does not work:
/(?:subject=)?CN\s*=\s*([*[a-z.0-9A-Z]+)
This is what my subject line looks like:
subject=O = schmoocon, OU = schmooball, CN = *.meathead.fun.tld
Any ideas?
@github-actions[bot] commented on GitHub (Jul 30, 2025):
Issue is now considered stale. If you want to keep it open, please comment 👍