From 88715b4099aeccc3df065d76d059a9cee4ed1d2d Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Wed, 25 Oct 2023 09:22:12 +0200 Subject: [PATCH] x --- internal/dslx/quic.go | 2 +- internal/dslx/quic_test.go | 14 ++++++++++++++ internal/dslx/tls.go | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/internal/dslx/quic.go b/internal/dslx/quic.go index 91d0b8eebc..327b6d4be6 100644 --- a/internal/dslx/quic.go +++ b/internal/dslx/quic.go @@ -30,7 +30,7 @@ type quicHandshakeFunc struct { // Options contains the options. Options []TLSHandshakeOption - // Rt is the runtime that owns us. + // Rt is the Runtime that owns us. Rt Runtime } diff --git a/internal/dslx/quic_test.go b/internal/dslx/quic_test.go index 9512783a71..d8a8b066ac 100644 --- a/internal/dslx/quic_test.go +++ b/internal/dslx/quic_test.go @@ -3,6 +3,7 @@ package dslx import ( "context" "crypto/tls" + "crypto/x509" "io" "testing" "time" @@ -15,12 +16,25 @@ import ( /* Test cases: +- Get quicHandshakeFunc with options - Apply quicHandshakeFunc: - with EOF - success - with sni */ func TestQUICHandshake(t *testing.T) { + t.Run("Get quicHandshakeFunc with options", func(t *testing.T) { + certpool := x509.NewCertPool() + certpool.AddCert(&x509.Certificate{}) + + f := QUICHandshake( + NewMinimalRuntime(model.DiscardLogger, time.Now()), + ) + if _, ok := f.(*quicHandshakeFunc); !ok { + t.Fatal("unexpected type. Expected: quicHandshakeFunc") + } + }) + t.Run("Apply quicHandshakeFunc", func(t *testing.T) { wasClosed := false plainConn := &mocks.QUICEarlyConnection{ diff --git a/internal/dslx/tls.go b/internal/dslx/tls.go index ee75086b4d..6ed1a63cdc 100644 --- a/internal/dslx/tls.go +++ b/internal/dslx/tls.go @@ -62,7 +62,7 @@ type tlsHandshakeFunc struct { // Options contains the options. Options []TLSHandshakeOption - // Rt is the runtime that owns us. + // Rt is the Runtime that owns us. Rt Runtime }