0

I'm using the simplest example to connect:

`from pybit.unified_trading import WebSocket
from time import sleep
ws = WebSocket(
   testnet=True,
   channel_type="linear",
)
def handle_message(message):
   print(message)
ws.orderbook_stream(
  depth=50,
  symbol="BTCUSDT",
callback=handle_message
)
while True:
   sleep(1)`

websocket._exceptions.WebSocketTimeoutException: WebSocket Unified V5 (Auth) (wss://stream.bybit.com/v5/private) connection failed. Too many connection attempts. pybit will no longer try to reconnect.

This error is only on vm win 2019 server. Сode good works on home PS. REST api works well exactly the same. A more detailed study shows error:

[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate.

trying

python -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --upgrade certifi / pycryptodome / cryptography / requests / pybit and anather sh**, install OpenSSL, IIS (for what?).

I read the entire thread on this problem, tried a lot of things, but still couldn't find a solution. What certificate is missing and where? What is missing from vm win 2019 server? It could be a problem with bybit on server? I have seen many requests with this problem and not 1 solution!

1 Answer 1

0

Under Windows environment, the appropriate pem file is not used for SSL communication. Therefore, you can create a new “SSL_CERT_FILE” in the system environment variable and copy and paste the PATH of cacert.pem in the python directory as the variable value.

https://note.com/python_btcfx/n/n05dc9e42eb53

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.