MCPcopy
hub / github.com/IBM/sarama / NewConfig

Function NewConfig

tools/tls/config.go:5–19  ·  view source on GitHub ↗
(clientCert, clientKey string)

Source from the content-addressed store, hash-verified

3import "crypto/tls"
4
5func NewConfig(clientCert, clientKey string) (*tls.Config, error) {
6 tlsConfig := tls.Config{
7 MinVersion: tls.VersionTLS12,
8 }
9
10 if clientCert != "" && clientKey != "" {
11 cert, err := tls.LoadX509KeyPair(clientCert, clientKey)
12 if err != nil {
13 return &tlsConfig, err
14 }
15 tlsConfig.Certificates = []tls.Certificate{cert}
16 }
17
18 return &tlsConfig, nil
19}

Callers 3

mainFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected