Skip to content

Commit

Permalink
http binding fix nilpointer
Browse files Browse the repository at this point in the history
Signed-off-by: Fabian Martinez <46371672+famarting@users.noreply.github.com>
  • Loading branch information
famarting committed Sep 10, 2024
1 parent dab1faa commit a8d2bb5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bindings/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ func (h *HTTPSource) Init(_ context.Context, meta bindings.Metadata) error {
if err != nil {
return err
}
if tlsConfig == nil {
tlsConfig = &tls.Config{MinVersion: tls.VersionTLS12}
}
if h.metadata.MTLSClientCert != "" && h.metadata.MTLSClientKey != "" {
err = h.readMTLSClientCertificates(tlsConfig)
if err != nil {
Expand Down Expand Up @@ -156,9 +159,6 @@ func (h *HTTPSource) readMTLSClientCertificates(tlsConfig *tls.Config) error {
if err != nil {
return fmt.Errorf("failed to load client certificate: %w", err)
}
if tlsConfig == nil {
tlsConfig = &tls.Config{MinVersion: tls.VersionTLS12}
}
tlsConfig.Certificates = []tls.Certificate{cert}
return nil
}
Expand Down

0 comments on commit a8d2bb5

Please sign in to comment.