connect/ca: return a better error message if the CA isn't fully initialized when signing

pull/5249/head
Kyle Havlovitz 2019-01-22 11:15:09 -08:00
parent ddc4a8d848
commit a28ba4687d
No known key found for this signature in database
GPG Key ID: 8A5E6B173056AD6C
1 changed files with 6 additions and 3 deletions

View File

@ -328,6 +328,9 @@ func (c *ConsulProvider) Sign(csr *x509.CertificateRequest) (string, error) {
if err != nil {
return "", err
}
if providerState.PrivateKey == "" {
return "", ErrNotInitialized
}
// Create the keyId for the cert from the signing private key.
signer, err := connect.ParseSigner(providerState.PrivateKey)