MCPcopy Create free account
hub / github.com/kataras/iris / NewInsecure

Function NewInsecure

httptest/httptest.go:153–178  ·  view source on GitHub ↗

NewInsecure same as New but receives a single host instead of the whole framework. Useful for testing running TLS servers.

(t IrisTesty, setters ...OptionSetter)

Source from the content-addressed store, hash-verified

151// NewInsecure same as New but receives a single host instead of the whole framework.
152// Useful for testing running TLS servers.
153func NewInsecure(t IrisTesty, setters ...OptionSetter) *httpexpect.Expect {
154 conf := DefaultConfiguration()
155 for _, setter := range setters {
156 setter.Set(conf)
157 }
158 transport := &http.Transport{
159 TLSClientConfig: &tls.Config{InsecureSkipVerify: true, MinVersion: tls.VersionTLS13}, // lint:ignore
160 }
161
162 testConfiguration := httpexpect.Config{
163 BaseURL: conf.URL,
164 Client: &http.Client{
165 Transport: transport,
166 Jar: httpexpect.NewCookieJar(),
167 },
168 Reporter: httpexpect.NewAssertReporter(t),
169 }
170
171 if conf.Debug {
172 testConfiguration.Printers = []httpexpect.Printer{
173 httpexpect.NewDebugPrinter(t, true),
174 }
175 }
176
177 return httpexpect.WithConfig(testConfiguration)
178}
179
180// Aliases for "net/http/httptest" package. See `Do` package-level function.
181var (

Callers 1

TestProxyFunction · 0.92

Calls 2

DefaultConfigurationFunction · 0.70
SetMethod · 0.65

Tested by 1

TestProxyFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…