Skip to content

Commit 8c4eb17

Browse files
change static certs setting after error check
1 parent c8dedf2 commit 8c4eb17

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

internal/data/init.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,10 +489,11 @@ func (d *database) loadInitialSettings() error {
489489

490490
if config.Values.Webserver.Tunnel.CertificatePath != "" {
491491
tunnelWebserverConfig.CertificatePEM, tunnelWebserverConfig.PrivateKeyPEM, err = d.readTLSPems(config.Values.Webserver.Tunnel.CertificatePath, config.Values.Webserver.Tunnel.PrivateKeyPath)
492-
tunnelWebserverConfig.StaticCerts=true
493492

494493
if err != nil {
495494
log.Printf("WARNING, failed to read tunnel TLS material: %s", err)
495+
} else {
496+
tunnelWebserverConfig.StaticCerts=true
496497
}
497498
}
498499

@@ -509,10 +510,11 @@ func (d *database) loadInitialSettings() error {
509510

510511
if config.Values.Webserver.Public.CertificatePath != "" {
511512
publicWebserverConfig.CertificatePEM, publicWebserverConfig.PrivateKeyPEM, err = d.readTLSPems(config.Values.Webserver.Public.CertificatePath, config.Values.Webserver.Public.PrivateKeyPath)
512-
publicWebserverConfig.StaticCerts=true
513513

514514
if err != nil {
515515
log.Printf("WARNING, failed to read public webserver TLS material: %s", err)
516+
} else {
517+
publicWebserverConfig.StaticCerts=true
516518
}
517519
}
518520

@@ -530,10 +532,11 @@ func (d *database) loadInitialSettings() error {
530532
if config.Values.Webserver.Management.CertificatePath != "" {
531533

532534
managementWebserverConfig.CertificatePEM, managementWebserverConfig.PrivateKeyPEM, err = d.readTLSPems(config.Values.Webserver.Management.CertificatePath, config.Values.Webserver.Management.PrivateKeyPath)
533-
managementWebserverConfig.StaticCerts=true
534535

535536
if err != nil {
536537
log.Printf("WARNING, failed to read public webserver TLS material: %s", err)
538+
} else {
539+
managementWebserverConfig.StaticCerts=true
537540
}
538541
}
539542

0 commit comments

Comments
 (0)