Skip to content

Commit

Permalink
Mitigate TLS matching issues on FreeBSD when X25519Kyber768Draft00 is…
Browse files Browse the repository at this point in the history
… involved (#252)
  • Loading branch information
Monviech authored Oct 4, 2024
1 parent ea27408 commit bdee6a6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions layer4/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ func (cx *Connection) Wrap(conn net.Conn) *Connection {
func (cx *Connection) prefetch() (err error) {
var n int

// TODO: FreeBSD will not match TLS with X25519Kyber768Draft00 based TLS ClientHello.
// Adding a short sleep here mitigates this behavior and makes TLS match.
// This needs a proper solution in the future.
time.Sleep(1 * time.Millisecond)

// read once
if len(cx.buf) < MaxMatchingBytes {
free := cap(cx.buf) - len(cx.buf)
Expand Down

0 comments on commit bdee6a6

Please sign in to comment.