forked from quic-go/quic-go
use tls.Config.ServerName for the passing the hostname around
This commit is contained in:
@@ -69,10 +69,9 @@ var (
|
||||
// NewCryptoSetupClient creates a new CryptoSetup instance for a client
|
||||
func NewCryptoSetupClient(
|
||||
cryptoStream io.ReadWriter,
|
||||
hostname string,
|
||||
connID protocol.ConnectionID,
|
||||
version protocol.VersionNumber,
|
||||
tlsConfig *tls.Config,
|
||||
tlsConf *tls.Config,
|
||||
params *TransportParameters,
|
||||
paramsChan chan<- TransportParameters,
|
||||
handshakeEvent chan<- struct{},
|
||||
@@ -87,10 +86,10 @@ func NewCryptoSetupClient(
|
||||
divNonceChan := make(chan struct{})
|
||||
cs := &cryptoSetupClient{
|
||||
cryptoStream: cryptoStream,
|
||||
hostname: hostname,
|
||||
hostname: tlsConf.ServerName,
|
||||
connID: connID,
|
||||
version: version,
|
||||
certManager: crypto.NewCertManager(tlsConfig),
|
||||
certManager: crypto.NewCertManager(tlsConf),
|
||||
params: params,
|
||||
keyDerivation: crypto.DeriveQuicCryptoAESKeys,
|
||||
nullAEAD: nullAEAD,
|
||||
|
||||
@@ -2,6 +2,7 @@ package handshake
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
@@ -121,10 +122,9 @@ var _ = Describe("Client Crypto Setup", func() {
|
||||
handshakeEvent = make(chan struct{}, 2)
|
||||
csInt, err := NewCryptoSetupClient(
|
||||
stream,
|
||||
"hostname",
|
||||
protocol.ConnectionID{1, 2, 3, 4, 5, 6, 7, 8},
|
||||
version,
|
||||
nil,
|
||||
&tls.Config{ServerName: "hostname"},
|
||||
&TransportParameters{IdleTimeout: protocol.DefaultIdleTimeout},
|
||||
paramsChan,
|
||||
handshakeEvent,
|
||||
|
||||
Reference in New Issue
Block a user