enable TLS 1.3 by default

pull/2141/head
liberal-boy 2019-04-15 23:21:47 +08:00
parent 7460f61f39
commit 15c0e975ca
1 changed files with 7 additions and 0 deletions

View File

@ -4,6 +4,7 @@ package tls
import (
"crypto/tls"
"os"
"v2ray.com/core/common/buf"
"v2ray.com/core/common/net"
@ -65,3 +66,9 @@ 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")
}