Skip to content

Commit

Permalink
Use CN from --hosts when provided
Browse files Browse the repository at this point in the history
  • Loading branch information
tresf committed Oct 9, 2020
1 parent 4cb9036 commit 0a8c36c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/qz/installer/certificate/CertificateChainBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public CertificateChainBuilder(String ... hostNames) {
public KeyPairWrapper createCaCert() throws IOException, GeneralSecurityException, OperatorException {
KeyPair keyPair = createRsaKey();

X509v3CertificateBuilder builder = createX509Cert(keyPair, CA_CERT_AGE);
X509v3CertificateBuilder builder = createX509Cert(keyPair, CA_CERT_AGE, hostNames);

builder.addExtension(Extension.basicConstraints, true, new BasicConstraints(1))
.addExtension(Extension.keyUsage, true, new KeyUsage(KeyUsage.keyCertSign + KeyUsage.cRLSign))
Expand All @@ -72,7 +72,7 @@ public KeyPairWrapper createCaCert() throws IOException, GeneralSecurityExceptio

public KeyPairWrapper createSslCert(KeyPairWrapper caKeyPairWrapper) throws IOException, GeneralSecurityException, OperatorException {
KeyPair sslKeyPair = createRsaKey();
X509v3CertificateBuilder builder = createX509Cert(sslKeyPair, SSL_CERT_AGE);
X509v3CertificateBuilder builder = createX509Cert(sslKeyPair, SSL_CERT_AGE, hostNames);

JcaX509ExtensionUtils utils = new JcaX509ExtensionUtils();

Expand Down

0 comments on commit 0a8c36c

Please sign in to comment.