mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 05:27:48 +00:00
fixed SAN extension field in certificate issuance
This commit is contained in:
+18
-2
@@ -1365,7 +1365,7 @@ export const internalCertificateAuthorityServiceFactory = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
let altNamesArray: {
|
let altNamesArray: {
|
||||||
type: "email" | "dns";
|
type: "email" | "dns" | "url" | "ip";
|
||||||
value: string;
|
value: string;
|
||||||
}[] = [];
|
}[] = [];
|
||||||
|
|
||||||
@@ -1390,6 +1390,14 @@ export const internalCertificateAuthorityServiceFactory = ({
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (z.string().url().safeParse(altName).success) {
|
||||||
|
return { type: "url", value: altName };
|
||||||
|
}
|
||||||
|
|
||||||
|
if (z.string().ip().safeParse(altName).success) {
|
||||||
|
return { type: "ip", value: altName };
|
||||||
|
}
|
||||||
|
|
||||||
// If altName is neither a valid email nor a valid hostname, throw an error or handle it accordingly
|
// If altName is neither a valid email nor a valid hostname, throw an error or handle it accordingly
|
||||||
throw new Error(`Invalid altName: ${altName}`);
|
throw new Error(`Invalid altName: ${altName}`);
|
||||||
});
|
});
|
||||||
@@ -1767,7 +1775,7 @@ export const internalCertificateAuthorityServiceFactory = ({
|
|||||||
|
|
||||||
let altNamesFromCsr: string = "";
|
let altNamesFromCsr: string = "";
|
||||||
let altNamesArray: {
|
let altNamesArray: {
|
||||||
type: "email" | "dns";
|
type: "email" | "dns" | "url" | "ip";
|
||||||
value: string;
|
value: string;
|
||||||
}[] = [];
|
}[] = [];
|
||||||
if (altNames) {
|
if (altNames) {
|
||||||
@@ -1791,6 +1799,14 @@ export const internalCertificateAuthorityServiceFactory = ({
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (z.string().url().safeParse(altName).success) {
|
||||||
|
return { type: "url", value: altName };
|
||||||
|
}
|
||||||
|
|
||||||
|
if (z.string().ip().safeParse(altName).success) {
|
||||||
|
return { type: "ip", value: altName };
|
||||||
|
}
|
||||||
|
|
||||||
// If altName is neither a valid email nor a valid hostname, throw an error or handle it accordingly
|
// If altName is neither a valid email nor a valid hostname, throw an error or handle it accordingly
|
||||||
throw new Error(`Invalid altName: ${altName}`);
|
throw new Error(`Invalid altName: ${altName}`);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user