Closed metagn closed 6 years ago
What's your OpenSSL version? My guess is it's too old.
openssl version
gives OpenSSL 1.1.0g 2 Nov 2017
weird, maybe you could Nim devel?
Port should be 443 not 80. That fixes for me if I don't verify the certificate while on port 80 won't work at all.
When I tried before with 443 it gave the same error, but now when I do port 80 it says wrong protocol and 443 gives 400 bad request on websocket upgrade. Guess this was on Discord.
Bad request may have been due to #28 . So, clone the repo or pull latest changes and try again on port 443. This should work:
import asyncdispatch, asyncnet, net
import websocket
let ws = waitFor newAsyncWebsocket(
"wss://gateway.discord.gg:443/?encoding=json&v=6",
ctx=newContext(verifyMode=CVerifyNone))
# ...
I tried on Linux, btw and port 80 gave me the same error as you
Holy crap thanks, it worked
On Windows 10 x64
Code:
Error (ws.nim(10) is the code above):
Tried changing the SSL context version to SSLv23 and TLSv1 yet still the same error.
Discord doesn't allow
ssl = false
and gives a 400 Bad Request on websocket upgrade.