7802ab714f
Initially there were pkg and private packages, however for all practical purposes there's no significant difference between them. It's clearer to have a single private package - and when we do get a specific abstraction that needs to be reused, we can move it to storj.io/common or storj.io/private. Change-Id: Ibc2036e67f312f5d63cb4a97f5a92e38ae413aa5
30 lines
955 B
Go
30 lines
955 B
Go
// Copyright (C) 2021 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
// +build !go1.15
|
|
|
|
package qtls
|
|
|
|
import (
|
|
"crypto/tls"
|
|
|
|
quicgo "github.com/lucas-clemente/quic-go"
|
|
)
|
|
|
|
// ToTLSConnectionState converts a quic-go connection state to tls connection
|
|
// state.
|
|
func ToTLSConnectionState(state quicgo.ConnectionState) tls.ConnectionState {
|
|
return tls.ConnectionState{
|
|
Version: state.TLS.Version,
|
|
HandshakeComplete: state.TLS.HandshakeComplete,
|
|
DidResume: state.TLS.DidResume,
|
|
CipherSuite: state.TLS.CipherSuite,
|
|
NegotiatedProtocol: state.TLS.NegotiatedProtocol,
|
|
ServerName: state.TLS.ServerName,
|
|
PeerCertificates: state.TLS.PeerCertificates,
|
|
VerifiedChains: state.TLS.VerifiedChains,
|
|
SignedCertificateTimestamps: state.TLS.SignedCertificateTimestamps,
|
|
OCSPResponse: state.TLS.OCSPResponse,
|
|
}
|
|
}
|