[PD1] Certs done
This commit is contained in:
parent
23584e2901
commit
2c4f1fd2fc
6 changed files with 104 additions and 29 deletions
|
@ -1,13 +1,21 @@
|
|||
package networking
|
||||
|
||||
import "net"
|
||||
import (
|
||||
"crypto/tls"
|
||||
"net"
|
||||
)
|
||||
|
||||
|
||||
type ClientTLSConfigProvider interface {
|
||||
GetTLSConfigClient() *tls.Config
|
||||
}
|
||||
|
||||
type Client[T any] struct {
|
||||
Connection Connection[T]
|
||||
}
|
||||
|
||||
func NewClient[T any]() Client[T] {
|
||||
dialConn, err := net.Dial("tcp", "localhost:8080")
|
||||
func NewClient[T any](clientTLSConfigProvider ClientTLSConfigProvider) Client[T] {
|
||||
dialConn, err := tls.Dial("tcp", "localhost:8080", clientTLSConfigProvider.GetTLSConfigClient())
|
||||
if err != nil {
|
||||
panic("Could not open connection to server")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue