Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClientOption.TlsConfig.ServerName should not contain port number #78

Closed
Andrey36652 opened this issue Jan 27, 2024 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@Andrey36652
Copy link

I'm trying to connect to wss://ws.okx.com:8443/ws/v5/public as a client and get error remote error: tls: handshake failure.
Reason is this line

gws/client.go

Line 59 in 5c407ad

option.TlsConfig.ServerName = URL.Host
should be

option.TlsConfig.ServerName = URL.Hostname()

because URL.Host includes port number, while URL.Hostname() does not

@lxzan
Copy link
Owner

lxzan commented Jan 28, 2024

Let's manually assign a value to the serverName first, we'll fix that later.

@lxzan lxzan added the bug Something isn't working label Jan 28, 2024
@lxzan
Copy link
Owner

lxzan commented Jan 28, 2024

Or use this commit hash for now

go get -u -v github.com/lxzan/gws@340485a22b22164fcea48ab8cc4e680a6f396100

@nightwolfz
Copy link

Thanks for the fix, I was also having problems with okx

@lxzan
Copy link
Owner

lxzan commented Feb 1, 2024

small problem

@lxzan lxzan closed this as completed Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants