mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-02-20 23:47:21 -05:00
Enable tls1.3 if not explicitly disabled
This commit is contained in:
parent
20f05b5373
commit
fa976b8a1b
@ -4,7 +4,6 @@ package tls
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"os"
|
||||
|
||||
"v2ray.com/core/common/buf"
|
||||
"v2ray.com/core/common/net"
|
||||
@ -66,9 +65,3 @@ func Server(c net.Conn, config *tls.Config) net.Conn {
|
||||
tlsConn := tls.Server(c, config)
|
||||
return &conn{Conn: tlsConn}
|
||||
}
|
||||
|
||||
func init() {
|
||||
// opt-in TLS 1.3 for Go1.12
|
||||
// TODO: remove this line when Go1.13 is released.
|
||||
_ = os.Setenv("GODEBUG", os.Getenv("GODEBUG")+",tls13=1")
|
||||
}
|
||||
|
16
transport/internet/tls/tls13_workaround.go
Normal file
16
transport/internet/tls/tls13_workaround.go
Normal file
@ -0,0 +1,16 @@
|
||||
// +build !confonly
|
||||
|
||||
package tls
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func init() {
|
||||
// opt-in TLS 1.3 for Go1.12
|
||||
// TODO: remove this line when Go1.13 is released.
|
||||
if !strings.Contains(os.Getenv("GODEBUG"), "tls13") {
|
||||
_ = os.Setenv("GODEBUG", os.Getenv("GODEBUG")+",tls13=1")
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user