Add minVersion setting for TLS & XTLS (#77)

This commit is contained in:
eMeab authored and GitHub committed 2020-12-16 05:20:24 +00:00
1 parent 45f44c401a
commit dab978749c
7 files changed
+150 -96

No files matched your search

+11
View File
@@ -1,6 +1,7 @@
package xtls
import (
"crypto/tls"
"crypto/x509"
"sync"
"time"
@@ -202,6 +203,16 @@ func (c *Config) GetXTLSConfig(opts ...Option) *xtls.Config {
config.NextProtos = []string{"h2", "http/1.1"}
}
switch c.MinVersion {
case "1.0":
config.MinVersion = tls.VersionTLS10
case "1.1":
config.MinVersion = tls.VersionTLS11
case "1.2":
config.MinVersion = tls.VersionTLS12
case "1.3":
config.MinVersion = tls.VersionTLS13
}
return config
}