fix: PEM bundle parsing
This commit is contained in:
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "azure-acme-provisioner",
|
||||
"version": "0.6.0",
|
||||
"version": "0.6.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "azure-acme-provisioner",
|
||||
"version": "0.6.0",
|
||||
"version": "0.6.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@azure/arm-authorization": "^9.0.0",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "azure-acme-provisioner",
|
||||
"version": "0.6.0",
|
||||
"version": "0.6.1",
|
||||
"author": {
|
||||
"name": "Sławomir Koszewski",
|
||||
"url": "https://github.com/skoszewski"
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ export function pfxToPem(pfxBuffer: Buffer, password = ''): PemBundle {
|
||||
}
|
||||
|
||||
export function parsePemBundle(bundle: string): PemBundle {
|
||||
const blocks = bundle.match(/-----BEGIN [^-]+-----[\s\S]+?-----END [^-]+-----/g) ?? [];
|
||||
const blocks = bundle.replace(/\\n/g, '\n').match(/-----BEGIN [^-]+-----[\s\S]+?-----END [^-]+-----/g) ?? [];
|
||||
const privateKeyPem = blocks.find(b => b.includes('PRIVATE KEY')) ?? '';
|
||||
const certs = blocks.filter(b => b.includes('CERTIFICATE'));
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user