Skip to content

Commit e76493a

Browse files
committed
fix: update cert regexp
1 parent d7eacd5 commit e76493a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/respect-core/src/utils/mtls/resolve-mtls-certificates.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function resolveCertificate(cert: string | undefined): string | undefined {
3434
function formatCertificate(cert: string): string {
3535
// Split the content into header, body, and footer
3636
const matches = cert.match(
37-
/^(-----BEGIN[^-]+-----)\s*([A-Za-z0-9+/=\s]+)\s*(-----END[^-]+-----)/
37+
/^(-----BEGIN[^-]+-----)\r?\n([A-Za-z0-9+/=\r\n\t ]+)\r?\n(-----END[^-]+-----)/
3838
);
3939
if (!matches) {
4040
throw new Error('Invalid certificate format');

0 commit comments

Comments
 (0)