1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-04-18 11:39:11 -04:00

global session cache

This commit is contained in:
v2ray
2016-08-11 23:21:23 +02:00
parent 9e997a5be7
commit f03c86f468

View File

@@ -27,6 +27,10 @@ const (
StreamSecurityTypeTLS StreamSecurityType = 1
)
var (
globalSessionCache = tls.NewLRUClientSessionCache(128)
)
type TLSSettings struct {
AllowInsecure bool
Certs []tls.Certificate
@@ -35,6 +39,7 @@ type TLSSettings struct {
func (this *TLSSettings) GetTLSConfig() *tls.Config {
config := &tls.Config{
InsecureSkipVerify: this.AllowInsecure,
ClientSessionCache: globalSessionCache,
}
config.Certificates = this.Certs