Skip to content

Commit 7d4ce7c

Browse files
chris-woodChristopher Wood
authored andcommitted
crypto/tls: Add ECHOffered bool to ConnectionState (#105)
Co-authored-by: Christopher Wood <[email protected]>
1 parent c434774 commit 7d4ce7c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/crypto/tls/common.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,10 @@ type ConnectionState struct {
338338
// accepted by the server.
339339
ECHAccepted bool
340340

341+
// ECHOffered is set if the ECH extension is present in the ClientHello.
342+
// This means the client has offered ECH or sent GREASE ECH.
343+
ECHOffered bool
344+
341345
// CFControl is used to pass additional TLS configuration information to
342346
// HTTP requests.
343347
//

src/crypto/tls/conn.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,6 +1475,7 @@ func (c *Conn) connectionStateLocked() ConnectionState {
14751475
state.SignedCertificateTimestamps = c.scts
14761476
state.OCSPResponse = c.ocspResponse
14771477
state.ECHAccepted = c.ech.accepted
1478+
state.ECHOffered = c.ech.offered || c.ech.greased
14781479
state.CFControl = c.config.CFControl
14791480
if !c.didResume && c.vers != VersionTLS13 {
14801481
if c.clientFinishedIsFirst {

0 commit comments

Comments
 (0)