From dc8af28d56b080724f7d43777ceaddf183a5c994 Mon Sep 17 00:00:00 2001 From: liberal-boy Date: Mon, 15 Apr 2019 23:21:47 +0800 Subject: [PATCH] enable TLS 1.3 by default --- transport/internet/tls/tls.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/transport/internet/tls/tls.go b/transport/internet/tls/tls.go index 90b60e02..85479954 100644 --- a/transport/internet/tls/tls.go +++ b/transport/internet/tls/tls.go @@ -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") +}