mirror of https://github.com/v2ray/v2ray-core
Enable tls1.3 if not explicitly disabled
parent
20f05b5373
commit
fa976b8a1b
|
@ -4,7 +4,6 @@ package tls
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"os"
|
|
||||||
|
|
||||||
"v2ray.com/core/common/buf"
|
"v2ray.com/core/common/buf"
|
||||||
"v2ray.com/core/common/net"
|
"v2ray.com/core/common/net"
|
||||||
|
@ -66,9 +65,3 @@ func Server(c net.Conn, config *tls.Config) net.Conn {
|
||||||
tlsConn := tls.Server(c, config)
|
tlsConn := tls.Server(c, config)
|
||||||
return &conn{Conn: tlsConn}
|
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")
|
|
||||||
}
|
|
||||||
|
|
|
@ -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…
Reference in New Issue