Skip to content

Commit

Permalink
Merge pull request #2666 from cosmos/alessio/2664-fix-dns-alt-name
Browse files Browse the repository at this point in the history
[R4R] Include DNS alt name in certificate
  • Loading branch information
rigelrozanski authored Nov 2, 2018
2 parents b6443e9 + a0a6bad commit 22ef944
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion client/lcd/certificates.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ func generateSelfSignedCert(host string) (certBytes []byte, priv *ecdsa.PrivateK
Subject: pkix.Name{
Organization: []string{"Gaia Lite"},
},
DNSNames: []string{"localhost"},
NotBefore: notBefore,
NotAfter: notAfter,
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign,
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
BasicConstraintsValid: true,
IsCA: true,
IsCA: true,
}
hosts := strings.Split(host, ",")
for _, h := range hosts {
Expand Down
2 changes: 1 addition & 1 deletion client/lcd/certificates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestGenerateSelfSignedCert(t *testing.T) {
cert, err := x509.ParseCertificate(certBytes)
require.Nil(t, err)
require.Equal(t, 2, len(cert.IPAddresses))
require.Equal(t, 1, len(cert.DNSNames))
require.Equal(t, 2, len(cert.DNSNames))
require.True(t, cert.IsCA)
}

Expand Down

0 comments on commit 22ef944

Please sign in to comment.