Skip to content

Commit

Permalink
Merge pull request openshift#24053 from stlaz/reqheaders_client_cert_…
Browse files Browse the repository at this point in the history
…broken

e2e requestheader: make client follow TLS correctly
  • Loading branch information
openshift-merge-robot authored Nov 9, 2019
2 parents 99175db + af18732 commit 608e80b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/extended/oauth/requestheaders.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ var _ = g.Describe("[Serial] [Feature:OAuthServer] [RequestHeaders] [IdP]", func
expectToken: true,
},
{
name: "/authorize - challenging-client - unknown CA cert: expect 500 because the verifier can generally return TLS errors :(",
name: "/authorize - challenging-client - unknown CA cert: expect 302 because we never get authenticated",
cert: unknownCACert,
key: unknownCAKey,
endpoint: "/oauth/authorize?client_id=openshift-challenging-client&response_type=token",
expectedError: "500 Internal Server Error",
expectedError: "302 Found",
},
{
name: "/authorize - challenging-client - wrong CN cert: expect 500 because the verifier can generally return TLS errors :(",
Expand All @@ -154,7 +154,7 @@ var _ = g.Describe("[Serial] [Feature:OAuthServer] [RequestHeaders] [IdP]", func
cert: unknownCACert,
key: unknownCAKey,
endpoint: "/metrics",
expectedError: "401 Unauthorized",
expectedError: "403 Forbidden",
},
{
name: "/healtz - anonymous: anyone should be able to access it",
Expand Down Expand Up @@ -430,7 +430,7 @@ func oauthHTTPRequest(caCerts *x509.CertPool, oauthBaseURL, endpoint, token stri
tlsCert, err := tls.X509KeyPair(certBytes, keyBytes)

o.Expect(err).NotTo(o.HaveOccurred())
transport.TLSClientConfig.GetClientCertificate = func(_ *tls.CertificateRequestInfo) (*tls.Certificate, error) { return &tlsCert, nil }
transport.TLSClientConfig.Certificates = []tls.Certificate{tlsCert}
}

oauthServerURL, err := url.Parse(oauthBaseURL)
Expand Down

0 comments on commit 608e80b

Please sign in to comment.