1 Star 0 Fork 0

tym_hmm / go-kafa-Shopify-sarama

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
config.go 393 Bytes
一键复制 编辑 原始数据 按行查看 历史
天蝎儿 提交于 2023-01-06 17:03 . build on 1.137.2
package tls
import "crypto/tls"
func NewConfig(clientCert, clientKey string) (*tls.Config, error) {
tlsConfig := tls.Config{
MinVersion: tls.VersionTLS12,
}
if clientCert != "" && clientKey != "" {
cert, err := tls.LoadX509KeyPair(clientCert, clientKey)
if err != nil {
return &tlsConfig, err
}
tlsConfig.Certificates = []tls.Certificate{cert}
}
return &tlsConfig, nil
}
Go
1
https://gitee.com/tym_hmm/go-kafa-shopify-sarama.git
git@gitee.com:tym_hmm/go-kafa-shopify-sarama.git
tym_hmm
go-kafa-shopify-sarama
go-kafa-Shopify-sarama
v1.37.2

搜索帮助