Skip to content

Commit 243571d

Browse files
committed
ldap: Don't fail hard when mTLS LDAP cannot be initiated
Instead pass the error to the caller.
1 parent 77cc8e2 commit 243571d

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

internal/service/ldap_service.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@ func (ldap *LdapService) Init() error {
4141
if ldap.config.AuthCert != "" && ldap.config.AuthKey != "" {
4242
cert, err := tls.LoadX509KeyPair(ldap.config.AuthCert, ldap.config.AuthKey)
4343
if err != nil {
44-
log.Fatal().Err(err).Msg("LDAP mTLS authentication")
45-
} else {
46-
ldap.cert = &cert
47-
log.Info().Msg("Using LDAP mTLS authentication")
44+
return fmt.Errorf("failed to initalize LDAP with mTLS authentication: %w", err)
4845
}
46+
ldap.cert = &cert
47+
log.Info().Msg("Using LDAP with mTLS authentication")
4948
}
5049
_, err := ldap.connect()
5150
if err != nil {

0 commit comments

Comments
 (0)