Fix uTLS fingerprints support

Thank @HirbodBehnam https://github.com/XTLS/Xray-core/issues/461
This commit is contained in:
RPRX 2021-04-01 09:15:18 +00:00 committed by GitHub
parent 95a68a6d73
commit 4bf8b6d89c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 31 deletions

View file

@ -18,8 +18,6 @@ var (
globalSessionCache = tls.NewLRUClientSessionCache(128)
)
const exp8357 = "experiment:8357"
// ParseCertificate converts a cert.Certificate to Certificate.
func ParseCertificate(c *cert.Certificate) *Certificate {
if c != nil {
@ -240,15 +238,7 @@ func getNewGetCertficateFunc(certs []*tls.Certificate) func(hello *tls.ClientHel
}
}
func (c *Config) IsExperiment8357() bool {
return strings.HasPrefix(c.ServerName, exp8357)
}
func (c *Config) parseServerName() string {
if c.IsExperiment8357() {
return c.ServerName[len(exp8357):]
}
return c.ServerName
}