mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-01 01:44:15 +00:00
Fix uTLS fingerprints support
Thank @HirbodBehnam https://github.com/XTLS/Xray-core/issues/461
This commit is contained in:
parent
95a68a6d73
commit
4bf8b6d89c
3 changed files with 39 additions and 31 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue