@@ -3,6 +3,7 @@ package main
33import (
44 "bytes"
55 "context"
6+ "crypto/tls"
67 "encoding/json"
78 "fmt"
89 "io"
@@ -72,14 +73,17 @@ func (j JoinCommandResponse) EmbeddedOverrides() (dig.Mapping, error) {
7273// getJoinToken issues a request to the kots api to get the actual join command
7374// based on the short token provided by the user.
7475func getJoinToken (ctx context.Context , baseURL , shortToken string ) (* JoinCommandResponse , error ) {
75- url := fmt .Sprintf ("http ://%s/api/v1/embedded-cluster/join?token=%s" , baseURL , shortToken )
76+ url := fmt .Sprintf ("https ://%s/api/v1/embedded-cluster/join?token=%s" , baseURL , shortToken )
7677 ctx , cancel := context .WithTimeout (ctx , time .Minute )
7778 defer cancel ()
7879 req , err := http .NewRequestWithContext (ctx , http .MethodGet , url , nil )
7980 if err != nil {
8081 return nil , fmt .Errorf ("unable to create request: %w" , err )
8182 }
82- resp , err := http .DefaultClient .Do (req )
83+
84+ // this will generally be a self-signed certificate created by kurl-proxy
85+ insecureClient := & http.Client {Transport : & http.Transport {TLSClientConfig : & tls.Config {InsecureSkipVerify : true }}}
86+ resp , err := insecureClient .Do (req )
8387 if err != nil {
8488 return nil , fmt .Errorf ("unable to get join token: %w" , err )
8589 }
0 commit comments