File tree 3 files changed +37
-3
lines changed
3 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -391,11 +391,10 @@ func (c *Config) GetTLSConfig(opts ...Option) *tls.Config {
391
391
}
392
392
}
393
393
if len (c .EchConfig ) > 0 {
394
- ECHConfig , err := base64 . StdEncoding . DecodeString ( c . EchConfig )
394
+ err := ApplyECH ( c , config )
395
395
if err != nil {
396
- errors .LogError (context .Background (), "invalid ECH config" )
396
+ errors .LogError (context .Background (), err )
397
397
}
398
- config .EncryptedClientHelloConfigList = ECHConfig
399
398
}
400
399
401
400
return config
Original file line number Diff line number Diff line change
1
+ //go:build go1.23
2
+ // +build go1.23
3
+
4
+ package tls
5
+
6
+ import (
7
+ "context"
8
+ "crypto/tls"
9
+ "encoding/base64"
10
+
11
+ "github.com/xtls/xray-core/common/errors"
12
+ )
13
+
14
+ func ApplyECH (c * Config , config * tls.Config ) error {
15
+ ECHConfig , err := base64 .StdEncoding .DecodeString (c .EchConfig )
16
+ if err != nil {
17
+ errors .LogError (context .Background (), "invalid ECH config" )
18
+ }
19
+ config .EncryptedClientHelloConfigList = ECHConfig
20
+ return nil
21
+ }
Original file line number Diff line number Diff line change
1
+ //go:build !go1.23
2
+ // +build !go1.23
3
+
4
+ package tls
5
+
6
+ import (
7
+ "crypto/tls"
8
+
9
+ "github.com/xtls/xray-core/common/errors"
10
+ )
11
+
12
+ func ApplyECH (c * Config , config * tls.Config ) error {
13
+ return errors .New ("Win7 does not support ECH" )
14
+ }
You can’t perform that action at this time.
0 commit comments