Skip to content

Commit bd0918f

Browse files
gouthamvediscordianfish
authored andcommitted
Expose the function to generate tls.Config
We're looking to reuse this in Cortex to client side encrypt our connections and not having this exposed is making us copy this entire function. Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
1 parent b14168c commit bd0918f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

https/tls_config.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ func getTLSConfig(configPath string) (*tls.Config, error) {
4545
if err != nil {
4646
return nil, err
4747
}
48-
return configToTLSConfig(&c.TLSConfig)
48+
return ConfigToTLSConfig(&c.TLSConfig)
4949
}
5050

51-
func configToTLSConfig(c *TLSStruct) (*tls.Config, error) {
51+
// ConfigToTLSConfig generates the golang tls.Config from the TLSStruct config.
52+
func ConfigToTLSConfig(c *TLSStruct) (*tls.Config, error) {
5253
cfg := &tls.Config{}
5354
if len(c.TLSCertPath) == 0 {
5455
return nil, errors.New("missing TLSCertPath")

0 commit comments

Comments
 (0)