mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
fixed SAN extension field in certificate issuance
This commit is contained in:
@@ -1365,7 +1365,7 @@ export const internalCertificateAuthorityServiceFactory = ({
|
||||
}
|
||||
|
||||
let altNamesArray: {
|
||||
type: "email" | "dns";
|
||||
type: "email" | "dns" | "url" | "ip";
|
||||
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
|
||||
throw new Error(`Invalid altName: ${altName}`);
|
||||
});
|
||||
@@ -1767,7 +1775,7 @@ export const internalCertificateAuthorityServiceFactory = ({
|
||||
|
||||
let altNamesFromCsr: string = "";
|
||||
let altNamesArray: {
|
||||
type: "email" | "dns";
|
||||
type: "email" | "dns" | "url" | "ip";
|
||||
value: string;
|
||||
}[] = [];
|
||||
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
|
||||
throw new Error(`Invalid altName: ${altName}`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user