[PD1] FIXED TLS Handshake
This commit is contained in:
parent
1cb81d2279
commit
4cf7880e57
5 changed files with 77 additions and 22 deletions
|
@ -7,7 +7,7 @@ import (
|
|||
|
||||
|
||||
type ClientTLSConfigProvider interface {
|
||||
GetTLSConfig() *tls.Config
|
||||
GetClientTLSConfig() *tls.Config
|
||||
}
|
||||
|
||||
type Client[T any] struct {
|
||||
|
@ -15,9 +15,9 @@ type Client[T any] struct {
|
|||
}
|
||||
|
||||
func NewClient[T any](clientTLSConfigProvider ClientTLSConfigProvider) Client[T] {
|
||||
dialConn, err := tls.Dial("tcp", "localhost:8080", clientTLSConfigProvider.GetTLSConfig())
|
||||
dialConn, err := tls.Dial("tcp", "localhost:8080", clientTLSConfigProvider.GetClientTLSConfig())
|
||||
if err != nil {
|
||||
log.Panicln("Could not open connection to server",err)
|
||||
log.Panicln("Server connection error:\n",err)
|
||||
}
|
||||
conn := NewConnection[T](dialConn)
|
||||
return Client[T]{Connection: conn}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue