Skip to content
Snippets Groups Projects
Commit 4c50b283 authored by Neil-Jocelyn Schark's avatar Neil-Jocelyn Schark
Browse files

move tls config in test

parent cdd8faee
Branches
No related tags found
1 merge request!208Draft: Resolve "Enable TLS for all local settings (integration-tests, debug, etc.)"
......@@ -79,15 +79,24 @@ func TestGetKSAKey(t *testing.T) { //nolint:gocyclo
logFileURL2 = logFileURL_ENV2
}
// TLS stuff
tlsConfig := config.TLSConfig{
Active: true,
CAFile: "../../../artifacts/integration-tests/ssl/ca.crt",
CertFile: "../../../artifacts/integration-tests/ssl/integration_test.crt",
KeyFile: "../../../artifacts/integration-tests/ssl/integration_test.key",
}
tlsConf, err := kmstls.GenerateTLSLibraryConfig(tlsConfig)
if err != nil {
t.Errorf("Error generating TLS config: %s", err)
}
transport := &http.Transport{
TLSClientConfig: tlsConf,
}
client := &http.Client{Transport: transport}
// Tell the qkdn-controller what devices to use.
_, err := utils.RunGosdncScript(gosdncScript, controllerURL)
_, err = utils.RunGosdncScript(gosdncScript, controllerURL)
if err != nil {
currentFolderPath := os.Getenv("PWD")
t.Errorf("Error running gosdnc script. Current folder path: %s, Error: %s", currentFolderPath, err)
......@@ -108,15 +117,6 @@ func TestGetKSAKey(t *testing.T) { //nolint:gocyclo
},
}
tlsConf, err := kmstls.GenerateTLSLibraryConfig(tlsConfig)
if err != nil {
t.Errorf("Error generating TLS config: %s", err)
}
transport := &http.Transport{
TLSClientConfig: tlsConf,
}
client := &http.Client{Transport: transport}
jsonData, err := json.Marshal(data)
if err != nil {
fmt.Println(err)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment