connect: generate intermediate at same time as root (#6272)
Generate intermediate at same time as root Co-Authored-By: Freddy <freddygv@users.noreply.github.com>
This commit is contained in:
parent
871ebb9dc2
commit
295abd82c3
|
@ -209,12 +209,21 @@ func (s *Server) initializeRootCA(provider ca.Provider, conf *structs.CAConfigur
|
|||
if err != nil {
|
||||
return fmt.Errorf("error getting root cert: %v", err)
|
||||
}
|
||||
|
||||
rootCA, err := parseCARoot(rootPEM, conf.Provider, conf.ClusterID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Also create the intermediate CA, which is the one that actually signs leaf certs
|
||||
interPEM, err := provider.GenerateIntermediate()
|
||||
if err != nil {
|
||||
return fmt.Errorf("error generating intermediate cert: %v", err)
|
||||
}
|
||||
_, err = connect.ParseCert(interPEM)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error getting intermediate cert: %v", err)
|
||||
}
|
||||
|
||||
commonConfig, err := conf.GetCommonConfig()
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue