Do not read issuer and signer twice.
This commit is contained in:
parent
aad8f9e582
commit
bd8dd9da41
1 changed files with 2 additions and 15 deletions
|
@ -218,21 +218,8 @@ func (a *Authority) init() error {
|
||||||
|
|
||||||
// Set issuer and signer for default CAS.
|
// Set issuer and signer for default CAS.
|
||||||
if options.HasType(casapi.SoftCAS) {
|
if options.HasType(casapi.SoftCAS) {
|
||||||
crt, err := pemutil.ReadCertificate(a.config.IntermediateCert)
|
options.Issuer = a.x509Issuer
|
||||||
if err != nil {
|
options.Signer = a.x509Signer
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
signer, err := a.keyManager.CreateSigner(&kmsapi.CreateSignerRequest{
|
|
||||||
SigningKey: a.config.IntermediateKey,
|
|
||||||
Password: []byte(a.config.Password),
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
options.Issuer = crt
|
|
||||||
options.Signer = signer
|
|
||||||
}
|
}
|
||||||
|
|
||||||
a.x509CAService, err = cas.New(context.Background(), options)
|
a.x509CAService, err = cas.New(context.Background(), options)
|
||||||
|
|
Loading…
Reference in a new issue