mirror of https://github.com/status-im/consul.git
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
64b235990d
commit
96be92f3b5
|
@ -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