{
"url":"https://aaf-sms:10443",
+ "servername":"aaf-sms.api.simpledemo.onap.org",
"cafile": "cert/aaf_root_ca.cer",
"clientcert":"client.cert",
"clientkey":"client.key",
//Struct to read json configuration file
type config struct {
- BackEndURL string `json:"url"`
- CAFile string `json:"cafile"`
- ClientCert string `json:"clientcert"`
- ClientKey string `json:"clientkey"`
- TimeOut string `json:"timeout"`
- DisableTLS bool `json:"disable_tls"`
+ BackEndURL string `json:"url"`
+ BackendServerName string `json:"servername"`
+ CAFile string `json:"cafile"`
+ ClientCert string `json:"clientcert"`
+ ClientKey string `json:"clientkey"`
+ TimeOut string `json:"timeout"`
+ DisableTLS bool `json:"disable_tls"`
}
//Load the config File for reading
}
}
+ // Allow https connection in k8s where servername does not match
+ // certificate server name
+ if cfg.BackendServerName != "" {
+ transport.TLSClientConfig.ServerName = cfg.BackendServerName
+ }
+
client := &http.Client{
Transport: &transport,
}