From 2c7cdf162375327df5a279f418cdadea52f9ae33 Mon Sep 17 00:00:00 2001 From: lastnigtic Date: Fri, 28 Oct 2022 18:55:25 +0800 Subject: [PATCH] fix(san): set an alternate `''` for `CN` --- lib/san.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/san.ts b/lib/san.ts index ab70b32..3d2f61c 100644 --- a/lib/san.ts +++ b/lib/san.ts @@ -12,7 +12,7 @@ export interface AltNameMatch function getNames( cert: PeerCertificate ) { - const CN = cert.subject?.CN; + const CN = cert.subject?.CN ?? ''; const sans = ( cert.subjectaltname ?? '' ) .split( ',' ) .map( name => name.trim( ) )