Skip to content

Commit

Permalink
Fix CA cert gen
Browse files Browse the repository at this point in the history
  • Loading branch information
zu1k committed Sep 15, 2021
1 parent e9b13df commit d97809e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/ca.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,17 @@ pub fn gen_ca() {
let mut param = CertificateParams::new(subject_alt_names);
let mut distinguished_name = DistinguishedName::new();
distinguished_name.push(DnType::CommonName, "Good-MITM CA Cert");
distinguished_name.push(DnType::OrganizationName, "Good-MITM");
param.distinguished_name = distinguished_name;
param.extended_key_usages = vec![ExtendedKeyUsagePurpose::Any];
param.key_usages = vec![
KeyUsagePurpose::DigitalSignature,
KeyUsagePurpose::ContentCommitment,
KeyUsagePurpose::KeyEncipherment,
KeyUsagePurpose::DataEncipherment,
KeyUsagePurpose::KeyAgreement,
KeyUsagePurpose::KeyCertSign,
KeyUsagePurpose::CrlSign,
];
param.is_ca = IsCa::Ca(BasicConstraints::Unconstrained);
let cert = Certificate::from_params(param).unwrap();
let cert_crt = cert.serialize_pem().unwrap();
Expand Down

0 comments on commit d97809e

Please sign in to comment.