How to create Python secure websocket client request?

后端 未结 4 520
半阙折子戏
半阙折子戏 2020-12-09 18:44

My Python secure websocket client code giving me exception as follows:

[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748)

4条回答
  •  心在旅途
    2020-12-09 19:50

    Finally I found a solution, I updated python client script while making connection to secure web socket url to ignore cert request as follows:

     import ssl
     import websocket
    
     ws = websocket.WebSocket(sslopt={"cert_reqs": ssl.CERT_NONE})
     ws.connect("wss://xxx.com:9090/websocket")
    

提交回复
热议问题