Bundle the CA public key in issued certificate
If the CA used is only an intermediate CA, and the root CA is trusted by the client, the client needs help verifying the certificate chain.
This commit is contained in:
parent
e1aa30e467
commit
6ff1746898
@ -151,5 +151,12 @@ func signCertificate(crt *v1alpha1.Certificate, issuerCert *x509.Certificate, pu
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("error encoding certificate PEM: %s", err.Error())
|
||||
}
|
||||
|
||||
// bundle the CA
|
||||
err = pem.Encode(pemBytes, &pem.Block{Type: "CERTIFICATE", Bytes: issuerCert.Raw})
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("error encoding issuer cetificate PEM: %s", err.Error())
|
||||
}
|
||||
|
||||
return pemBytes.Bytes(), cert, err
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user