Fixed loginUrl with "WithTLS()" used. Added "WithTLS()" to scenario integration tests (#2187)

This commit is contained in:
hopleus 2024-10-15 15:38:43 +03:00 committed by GitHub
parent 0602304cea
commit 52a3b54ba2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 31 additions and 3 deletions

View file

@ -68,6 +68,7 @@ func TestOIDCAuthenticationPingAll(t *testing.T) {
spec,
hsic.WithTestName("oidcauthping"),
hsic.WithConfigEnv(oidcMap),
hsic.WithTLS(),
hsic.WithHostnameAsServerURL(),
hsic.WithFileInContainer("/tmp/hs_client_oidc_secret", []byte(oidcConfig.ClientSecret)),
)
@ -299,6 +300,10 @@ func (s *AuthOIDCScenario) runTailscaleUp(
loginURL.Host = fmt.Sprintf("%s:8080", headscale.GetIP())
loginURL.Scheme = "http"
if len(headscale.GetCert()) > 0 {
loginURL.Scheme = "https"
}
insecureTransport := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // nolint
}