diff options
author | 2018-04-30 11:14:19 -0700 | |
---|---|---|
committer | 2018-04-30 16:08:46 -0700 | |
commit | 863dfe2206ec754c58acd5317e611e037d751a82 (patch) | |
tree | 0de938879e211ccc1e5b2973688eae5a09e983c7 /sms-service/src/quorumclient/quorumclient.go | |
parent | 9b0c49486855c84e3c24eeffdf71045748a0837b (diff) |
Using SNI for service names to support k8s
Using SNI in quorum client connection to
connect to SMS service via https
Issue-ID: AAF-265
Change-Id: I5108e9d734f11a4f74c41a41a2d8cd2f72c62b36
Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
Diffstat (limited to 'sms-service/src/quorumclient/quorumclient.go')
-rw-r--r-- | sms-service/src/quorumclient/quorumclient.go | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/sms-service/src/quorumclient/quorumclient.go b/sms-service/src/quorumclient/quorumclient.go index 9db6da8..9ef8f00 100644 --- a/sms-service/src/quorumclient/quorumclient.go +++ b/sms-service/src/quorumclient/quorumclient.go @@ -105,12 +105,13 @@ func main() { //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 @@ -155,6 +156,12 @@ func main() { } } + // 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, } |