cleanup dynamic cert e2e tests
This commit is contained in:
parent
a3634500f5
commit
c073bfc8b3
2 changed files with 35 additions and 172 deletions
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
|||
package lua
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"regexp"
|
||||
|
|
@ -170,6 +171,21 @@ func ensureRequest(f *framework.Framework, host string) {
|
|||
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
|
||||
}
|
||||
|
||||
func ensureHTTPSRequest(url string, host string, expectedDNSName string) {
|
||||
resp, _, errs := gorequest.New().
|
||||
Get(url).
|
||||
Set("Host", host).
|
||||
TLSClientConfig(&tls.Config{
|
||||
InsecureSkipVerify: true,
|
||||
ServerName: host,
|
||||
}).
|
||||
End()
|
||||
Expect(errs).Should(BeEmpty())
|
||||
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
|
||||
Expect(len(resp.TLS.PeerCertificates)).Should(BeNumerically("==", 1))
|
||||
Expect(resp.TLS.PeerCertificates[0].DNSNames[0]).Should(Equal(expectedDNSName))
|
||||
}
|
||||
|
||||
func getCookie(name string, cookies []*http.Cookie) (*http.Cookie, error) {
|
||||
for _, cookie := range cookies {
|
||||
if cookie.Name == name {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue