Skip to content

Commit

Permalink
fixup! Add HTTP client to certificate manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielius1922 committed Oct 31, 2024
1 parent ed3f2e0 commit 950a671
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions certificate-authority/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ apis:
keyFile: "/secrets/private/cert.key"
certFile: "/secrets/private/cert.crt"
clientCertificateRequired: true

authorization:
ownerClaim: "sub"
audience: ""
Expand Down
4 changes: 3 additions & 1 deletion pkg/security/certManager/general/certManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ type Config struct {
ClientCertificateRequired bool `yaml:"clientCertificateRequired" json:"clientCertificateRequired" description:"require client certificate"`
UseSystemCAPool bool `yaml:"useSystemCAPool" json:"useSystemCaPool" description:"use system certification pool"`
CRL pkgTls.CRLConfig `yaml:"crl" json:"crl"`

CAPoolIsOptional bool `yaml:"-" json:"-"`
}

func (c Config) Validate() error {
if len(c.CAPool) == 0 && !c.UseSystemCAPool {
if len(c.CAPool) == 0 && !c.UseSystemCAPool && !c.CAPoolIsOptional {
return fmt.Errorf("caPool('%v')", c.CAPool)
}
if c.CertFile == "" {
Expand Down
1 change: 1 addition & 0 deletions pkg/security/certManager/server/certManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func New(config Config, fileWatcher *fsnotify.Watcher, logger log.Logger, tracer
}
cfg := general.Config{
CAPool: config.caPoolArray,
CAPoolIsOptional: config.CAPoolIsOptional,
KeyFile: config.KeyFile,
CertFile: config.CertFile,
ClientCertificateRequired: config.ClientCertificateRequired,
Expand Down

0 comments on commit 950a671

Please sign in to comment.