forked from quic-go/quic-go
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:
committed by
GitHub
parent
aab4d4e410
commit
571d3adef4
2
.github/workflows/cross-compile.yml
vendored
2
.github/workflows/cross-compile.yml
vendored
@@ -4,7 +4,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
go: [ "1.20.x", "1.21.0-rc.3" ]
|
||||
go: [ "1.20.x", "1.21.x" ]
|
||||
runs-on: ${{ fromJSON(vars['CROSS_COMPILE_RUNNER_UBUNTU'] || '"ubuntu-latest"') }}
|
||||
name: "Cross Compilation (Go ${{matrix.go}})"
|
||||
steps:
|
||||
|
||||
2
.github/workflows/integration.yml
vendored
2
.github/workflows/integration.yml
vendored
@@ -5,7 +5,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
go: [ "1.20.x", "1.21.0-rc.3" ]
|
||||
go: [ "1.20.x", "1.21.x" ]
|
||||
runs-on: ${{ fromJSON(vars['INTEGRATION_RUNNER_UBUNTU'] || '"ubuntu-latest"') }}
|
||||
env:
|
||||
DEBUG: false # set this to true to export qlogs and save them as artifacts
|
||||
|
||||
2
.github/workflows/unit.yml
vendored
2
.github/workflows/unit.yml
vendored
@@ -7,7 +7,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ "ubuntu", "windows", "macos" ]
|
||||
go: [ "1.20.x", "1.21.0-rc.3" ]
|
||||
go: [ "1.20.x", "1.21.x" ]
|
||||
runs-on: ${{ fromJSON(vars[format('UNIT_RUNNER_{0}', matrix.os)] || format('"{0}-latest"', matrix.os)) }}
|
||||
name: Unit tests (${{ matrix.os}}, Go ${{ matrix.go }})
|
||||
steps:
|
||||
|
||||
@@ -359,7 +359,7 @@ func (h *cryptoSetup) GetSessionTicket() ([]byte, error) {
|
||||
if h.tlsConf.SessionTicketsDisabled {
|
||||
return nil, nil
|
||||
}
|
||||
if err := h.conn.SendSessionTicket(h.allow0RTT); err != nil {
|
||||
if err := qtls.SendSessionTicket(h.conn, h.allow0RTT); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ev := h.conn.NextEvent()
|
||||
|
||||
@@ -139,3 +139,7 @@ func SetCipherSuite(id uint16) (reset func()) {
|
||||
cipherSuitesModified = false
|
||||
}
|
||||
}
|
||||
|
||||
func SendSessionTicket(c *QUICConn, allow0RTT bool) error {
|
||||
return c.SendSessionTicket(allow0RTT)
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ type (
|
||||
QUICEvent = tls.QUICEvent
|
||||
QUICEventKind = tls.QUICEventKind
|
||||
QUICEncryptionLevel = tls.QUICEncryptionLevel
|
||||
QUICSessionTicketOptions = tls.QUICSessionTicketOptions
|
||||
AlertError = tls.AlertError
|
||||
)
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user