feat: add fingerprint for tls verify

This commit is contained in:
Skyxim
2022-07-10 20:44:24 +08:00
parent 60e1947ed2
commit fef9f95e65
15 changed files with 137 additions and 31 deletions

View File

@ -4,6 +4,7 @@ import (
"context"
"crypto/tls"
"fmt"
tlsC "github.com/Dreamacro/clash/common/tls"
"net"
"net/http"
"strconv"
@ -227,12 +228,12 @@ func NewTrojan(option TrojanOption) (*Trojan, error) {
return c, nil
}
tlsConfig := &tls.Config{
tlsConfig := tlsC.MixinTLSConfig(&tls.Config{
NextProtos: option.ALPN,
MinVersion: tls.VersionTLS12,
InsecureSkipVerify: tOption.SkipCertVerify,
ServerName: tOption.ServerName,
}
})
if t.option.Flow != "" {
t.transport = gun.NewHTTP2XTLSClient(dialFn, tlsConfig)