Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone committed Oct 25, 2023
1 parent d1d3142 commit 88715b4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/dslx/quic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
14 changes: 14 additions & 0 deletions internal/dslx/quic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package dslx
import (
"context"
"crypto/tls"
"crypto/x509"
"io"
"testing"
"time"
Expand All @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion internal/dslx/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 88715b4

Please sign in to comment.