summaryrefslogtreecommitdiff
path: root/internal/client/gateway/gateway.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/client/gateway/gateway.go')
-rw-r--r--internal/client/gateway/gateway.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/internal/client/gateway/gateway.go b/internal/client/gateway/gateway.go
index 11d15bb..38140e8 100644
--- a/internal/client/gateway/gateway.go
+++ b/internal/client/gateway/gateway.go
@@ -15,6 +15,7 @@ import (
tea "github.com/charmbracelet/bubbletea"
"github.com/kyren223/eko/certs"
+ "github.com/kyren223/eko/internal/client/config"
"github.com/kyren223/eko/internal/client/ui"
"github.com/kyren223/eko/internal/packet"
"github.com/kyren223/eko/pkg/assert"
@@ -44,9 +45,10 @@ func init() {
}
tlsConfig = &tls.Config{
- RootCAs: certPool,
- ServerName: "localhost",
- MinVersion: tls.VersionTLS12,
+ RootCAs: certPool,
+ ServerName: config.Read().ServerName,
+ MinVersion: tls.VersionTLS12,
+ InsecureSkipVerify: config.Read().InsecureSkipServerVerification,
}
}
@@ -71,7 +73,8 @@ func connect(ctx context.Context, privKey ed25519.PrivateKey) (snowflake.ID, err
errChan := make(chan error, 1)
go func() {
framer = packet.NewFramer()
- connection, err := tls.Dial("tcp4", ":7223", tlsConfig)
+ address := config.Read().ServerName
+ connection, err := tls.Dial("tcp4", address + ":7223", tlsConfig)
if err != nil {
errChan <- err
return