// Currently, it can only be called once.
func (q *QUICConn) SendSessionTicket(opts QUICSessionTicketOptions) error {
c := q.conn
+ if c.config.SessionTicketsDisabled {
+ return nil
+ }
if !c.isHandshakeComplete.Load() {
return quicError(errors.New("tls: SendSessionTicket called before handshake completed"))
}
if !cli2.conn.ConnectionState().DidResume {
t.Errorf("second connection did not use session resumption")
}
+
+ clientConfig.TLSConfig.SessionTicketsDisabled = true
+ cli3 := newTestQUICClient(t, clientConfig)
+ cli3.conn.SetTransportParameters(nil)
+ srv3 := newTestQUICServer(t, serverConfig)
+ srv3.conn.SetTransportParameters(nil)
+ if err := runTestQUICConnection(context.Background(), cli3, srv3, nil); err != nil {
+ t.Fatalf("error during third connection handshake: %v", err)
+ }
+ if cli3.conn.ConnectionState().DidResume {
+ t.Errorf("third connection unexpectedly used session resumption")
+ }
}
func TestQUICFragmentaryData(t *testing.T) {