Commit 20cd7bc2 authored by Darren Shepherd's avatar Darren Shepherd Committed by Alena Prokharchyk
Browse files

Assign TLS certs for fix local HA websockets

parent 42c27f3c
Showing with 14 additions and 0 deletions
+14 -0
......@@ -62,6 +62,20 @@ func NewLocal(localConfig *rest.Config, cluster *v3.Cluster) (*RemoteService, er
return nil, err
}
if localConfig.TLSClientConfig.CAFile != "" && localConfig.BearerToken != "" {
httpTransport := &http.Transport{}
certBytes, err := base64.StdEncoding.DecodeString(cluster.Status.CACert)
if err != nil {
return nil, err
}
certs := x509.NewCertPool()
certs.AppendCertsFromPEM(certBytes)
httpTransport.TLSClientConfig = &tls.Config{
RootCAs: certs,
}
transport = httpTransport
}
rs := &RemoteService{
cluster: cluster,
url: func() (url.URL, error) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment