fix compatibility with API breaking change in Go 1.21 (#4020)

* add Go 1.21 compatibility

Signed-off-by: Eric Lagergren <elagergren@spideroak-inc.com>

* refactor for Go 1.20

Signed-off-by: Eric Lagergren <elagergren@spideroak-inc.com>

---------

Signed-off-by: Eric Lagergren <elagergren@spideroak-inc.com>
This commit is contained in:
elagergren-spideroak
2023-08-09 05:22:30 -07:00
committed by GitHub
parent aab4d4e410
commit 571d3adef4
6 changed files with 21 additions and 10 deletions

View File

@@ -139,3 +139,7 @@ func SetCipherSuite(id uint16) (reset func()) {
cipherSuitesModified = false
}
}
func SendSessionTicket(c *QUICConn, allow0RTT bool) error {
return c.SendSessionTicket(allow0RTT)
}

View File

@@ -11,12 +11,13 @@ import (
)
type (
QUICConn = tls.QUICConn
QUICConfig = tls.QUICConfig
QUICEvent = tls.QUICEvent
QUICEventKind = tls.QUICEventKind
QUICEncryptionLevel = tls.QUICEncryptionLevel
AlertError = tls.AlertError
QUICConn = tls.QUICConn
QUICConfig = tls.QUICConfig
QUICEvent = tls.QUICEvent
QUICEventKind = tls.QUICEventKind
QUICEncryptionLevel = tls.QUICEncryptionLevel
QUICSessionTicketOptions = tls.QUICSessionTicketOptions
AlertError = tls.AlertError
)
const (
@@ -152,3 +153,9 @@ func findExtraData(extras [][]byte) []byte {
}
return nil
}
func SendSessionTicket(c *QUICConn, allow0RTT bool) error {
return c.SendSessionTicket(tls.QUICSessionTicketOptions{
EarlyData: allow0RTT,
})
}