+ san email
This commit is contained in:
parent
8c1add6ff1
commit
fa9c1ecb2c
@ -343,9 +343,16 @@ impl ICryptoProvider for OpenSSLLibProvider {
|
|||||||
csr_builder.set_version(2).context("set version")?;
|
csr_builder.set_version(2).context("set version")?;
|
||||||
|
|
||||||
let context = csr_builder.x509v3_context(Some(&conf));
|
let context = csr_builder.x509v3_context(Some(&conf));
|
||||||
|
|
||||||
let mut san_extension = SubjectAlternativeName::new();
|
let mut san_extension = SubjectAlternativeName::new();
|
||||||
san_extension.dns(self.vars.get("KEY_NAME").unwrap());
|
if let Some(name) = self.vars.get("KEY_NAME") {
|
||||||
|
san_extension.dns(name);
|
||||||
|
}
|
||||||
|
if let Some(email) = self.vars.get("KEY_EMAIL") {
|
||||||
|
san_extension.email(email);
|
||||||
|
}
|
||||||
let san_ext = san_extension.build(&context).context("build san")?;
|
let san_ext = san_extension.build(&context).context("build san")?;
|
||||||
|
|
||||||
st.push(san_ext).context("push san")?;
|
st.push(san_ext).context("push san")?;
|
||||||
|
|
||||||
csr_builder
|
csr_builder
|
||||||
@ -416,9 +423,16 @@ impl ICryptoProvider for OpenSSLLibProvider {
|
|||||||
.context("set_subject_name")?;
|
.context("set_subject_name")?;
|
||||||
|
|
||||||
let context = builder.x509v3_context(Some(&ca_cert), None);
|
let context = builder.x509v3_context(Some(&ca_cert), None);
|
||||||
|
|
||||||
let mut san_extension = SubjectAlternativeName::new();
|
let mut san_extension = SubjectAlternativeName::new();
|
||||||
san_extension.dns(self.vars.get("KEY_NAME").unwrap());
|
if let Some(name) = self.vars.get("KEY_NAME") {
|
||||||
|
san_extension.dns(name);
|
||||||
|
}
|
||||||
|
if let Some(email) = self.vars.get("KEY_EMAIL") {
|
||||||
|
san_extension.email(email);
|
||||||
|
}
|
||||||
let san_ext = san_extension.build(&context).context("build san")?;
|
let san_ext = san_extension.build(&context).context("build san")?;
|
||||||
|
|
||||||
builder
|
builder
|
||||||
.append_extension(san_ext)
|
.append_extension(san_ext)
|
||||||
.context("append san ext")?;
|
.context("append san ext")?;
|
||||||
|
Loading…
Reference in New Issue
Block a user