Skip to content

Commit d817ce6

Browse files
committed
Fix --tls-random with --ech, closes #38
1 parent d1746e9 commit d817ce6

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ adheres to [Semantic Versioning][semver].
1111

1212
## [Unreleased]
1313

14+
### Fixed
15+
16+
* Fixed the issue with `--tls-random` when it's used with `--ech`. ([#38][#38])
17+
18+
[#38]: https://github.com/ameshkov/gocurl/issues/38
19+
1420
[unreleased]: https://github.com/ameshkov/gocurl/compare/v1.4.8...HEAD
1521

1622
## [1.4.8] - 2025-05-13

internal/client/cfcrypto/cfcrypto.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ func Handshake(
7878
NextProtos: tlsConfig.NextProtos,
7979
}
8080

81+
// Copy Rand if set (for --tls-random support with ECH and regular TLS)
82+
if tlsConfig.Rand != nil {
83+
conf.Rand = tlsConfig.Rand
84+
}
85+
8186
// In the case of regular http.Transport it can handle h2 upgrade with the
8287
// regular tls.Conn only so remove h2 from NextProtos in this case.
8388
//

internal/client/transport.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func NewTransport(cfg *config.Config, out *output.Output) (rt Transport, err err
7777
}
7878

7979
// createHTTPTransport creates http.RoundTripper that will be used by the
80-
// *http.Client. Depending on the configuration it may create a H1, H2 or H3
80+
// *http.Client. Depending on the configuration it may create an H1, H2 or H3
8181
// transport.
8282
func createHTTPTransport(
8383
d *clientDialer,
@@ -94,15 +94,15 @@ func createHTTPTransport(
9494
return createH12Transport(d)
9595
}
9696

97-
// createH3Transport creates a http.RoundTripper to be used in HTTP/3 client.
97+
// createH3Transport creates an http.RoundTripper to be used in HTTP/3 client.
9898
func createH3Transport(d *clientDialer) (rt http.RoundTripper, err error) {
9999
return &http3.RoundTripper{
100100
DisableCompression: true,
101101
Dial: d.DialQUIC,
102102
}, nil
103103
}
104104

105-
// h2Transport is a http.RoundTripper implementation that forcibly use
105+
// h2Transport is an http.RoundTripper implementation that forcibly use
106106
// http2.Transport.
107107
type h2Transport struct {
108108
d *clientDialer

0 commit comments

Comments
 (0)