mirror of
https://github.com/kataras/iris.git
synced 2025-12-17 18:07:01 +00:00
set min version on tls configuration even on the tests and examples
This commit is contained in:
@@ -25,8 +25,8 @@
|
|||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
<strong>Read more at: <a href="https://golang.org/pkg/html/template" target="_new">
|
<strong>Read more at: <a href="https://pkg.go.dev/html/template" target="_new">
|
||||||
https://golang.org/pkg/html/template</a>
|
https://pkg.go.dev/html/template</a>
|
||||||
</strong>
|
</strong>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -2,7 +2,9 @@ module github.com/kataras/iris/_examples/websocket/basic
|
|||||||
|
|
||||||
go 1.17
|
go 1.17
|
||||||
|
|
||||||
|
// replace github.com/kataras/iris/v12 => ../../../
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/iris-contrib/middleware/jwt v0.0.0-20200710202437-92b01b85baaf
|
github.com/iris-contrib/middleware/jwt v0.0.0-20220301201128-27fa0f6a7d7e
|
||||||
github.com/kataras/iris/v12 master
|
github.com/kataras/iris/v12 v12.2.0-alpha9.0.20220310184134-096349bb56d8
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -113,8 +113,14 @@ func main() {
|
|||||||
ctx.ServeFile("./browser/index.html")
|
ctx.ServeFile("./browser/index.html")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
app.Get("/other", func(ctx iris.Context) {
|
||||||
|
ctx.WriteString("Other route")
|
||||||
|
})
|
||||||
|
|
||||||
// serves the npm browser websocket client usage example.
|
// serves the npm browser websocket client usage example.
|
||||||
app.HandleDir("/browserify", iris.Dir("./browserify"))
|
app.HandleDir("/browserify", iris.Dir("./browserify"))
|
||||||
|
|
||||||
|
// http://localhost:8080
|
||||||
|
// http://localhost:8080/browserify/client.html
|
||||||
app.Listen(":8080")
|
app.Listen(":8080")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import (
|
|||||||
// Look `ProxyHandlerRemote` too.
|
// Look `ProxyHandlerRemote` too.
|
||||||
func ProxyHandler(target *url.URL, config *tls.Config) *httputil.ReverseProxy {
|
func ProxyHandler(target *url.URL, config *tls.Config) *httputil.ReverseProxy {
|
||||||
if config == nil {
|
if config == nil {
|
||||||
config = &tls.Config{MinVersion: tls.VersionTLS11}
|
config = &tls.Config{MinVersion: tls.VersionTLS13}
|
||||||
}
|
}
|
||||||
|
|
||||||
director := func(req *http.Request) {
|
director := func(req *http.Request) {
|
||||||
@@ -89,7 +89,7 @@ func modifyProxiedRequest(req *http.Request, target *url.URL) {
|
|||||||
// Look `ProxyHandler` too.
|
// Look `ProxyHandler` too.
|
||||||
func ProxyHandlerRemote(target *url.URL, config *tls.Config) *httputil.ReverseProxy {
|
func ProxyHandlerRemote(target *url.URL, config *tls.Config) *httputil.ReverseProxy {
|
||||||
if config == nil {
|
if config == nil {
|
||||||
config = &tls.Config{MinVersion: tls.VersionTLS11}
|
config = &tls.Config{MinVersion: tls.VersionTLS13}
|
||||||
}
|
}
|
||||||
|
|
||||||
director := func(req *http.Request) {
|
director := func(req *http.Request) {
|
||||||
|
|||||||
@@ -27,8 +27,7 @@ func TestProxy(t *testing.T) {
|
|||||||
|
|
||||||
config := &tls.Config{
|
config := &tls.Config{
|
||||||
InsecureSkipVerify: true,
|
InsecureSkipVerify: true,
|
||||||
MinVersion: tls.VersionTLS11,
|
MinVersion: tls.VersionTLS13,
|
||||||
MaxVersion: tls.VersionTLS12,
|
|
||||||
}
|
}
|
||||||
proxy := host.NewProxy("", u, config)
|
proxy := host.NewProxy("", u, config)
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ func newTester(t *testing.T, baseURL string, handler http.Handler) *httpexpect.E
|
|||||||
|
|
||||||
if strings.HasPrefix(baseURL, "http") { // means we are testing real serve time
|
if strings.HasPrefix(baseURL, "http") { // means we are testing real serve time
|
||||||
transporter = &http.Transport{
|
transporter = &http.Transport{
|
||||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true, MinVersion: tls.VersionTLS11},
|
TLSClientConfig: &tls.Config{InsecureSkipVerify: true, MinVersion: tls.VersionTLS13},
|
||||||
}
|
}
|
||||||
} else { // means we are testing the handler itself
|
} else { // means we are testing the handler itself
|
||||||
transporter = httpexpect.NewBinder(handler)
|
transporter = httpexpect.NewBinder(handler)
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ func CERT(addr string, cert tls.Certificate) (net.Listener, error) {
|
|||||||
tlsConfig := &tls.Config{
|
tlsConfig := &tls.Config{
|
||||||
Certificates: []tls.Certificate{cert},
|
Certificates: []tls.Certificate{cert},
|
||||||
PreferServerCipherSuites: true,
|
PreferServerCipherSuites: true,
|
||||||
MinVersion: tls.VersionTLS11,
|
MinVersion: tls.VersionTLS13,
|
||||||
}
|
}
|
||||||
return tls.NewListener(l, tlsConfig), nil
|
return tls.NewListener(l, tlsConfig), nil
|
||||||
}
|
}
|
||||||
@@ -146,7 +146,7 @@ func LETSENCRYPT(addr string, reuse bool, serverName string, cacheDirOptional ..
|
|||||||
} else {
|
} else {
|
||||||
m.Cache = autocert.DirCache(cacheDir)
|
m.Cache = autocert.DirCache(cacheDir)
|
||||||
}
|
}
|
||||||
tlsConfig := &tls.Config{GetCertificate: m.GetCertificate, MinVersion: tls.VersionTLS11}
|
tlsConfig := &tls.Config{GetCertificate: m.GetCertificate, MinVersion: tls.VersionTLS13}
|
||||||
|
|
||||||
// use InsecureSkipVerify or ServerName to a value
|
// use InsecureSkipVerify or ServerName to a value
|
||||||
if serverName == "" {
|
if serverName == "" {
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ func NewInsecure(t *testing.T, setters ...OptionSetter) *httpexpect.Expect {
|
|||||||
setter.Set(conf)
|
setter.Set(conf)
|
||||||
}
|
}
|
||||||
transport := &http.Transport{
|
transport := &http.Transport{
|
||||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true, MinVersion: tls.VersionTLS11}, // lint:ignore
|
TLSClientConfig: &tls.Config{InsecureSkipVerify: true, MinVersion: tls.VersionTLS13}, // lint:ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
testConfiguration := httpexpect.Config{
|
testConfiguration := httpexpect.Config{
|
||||||
|
|||||||
Reference in New Issue
Block a user