How to pass client certificate to WebSocket in Python?

Viewed 357

How to pass client certificate to WebSocket in Python? What are the options for specifying paths to SSL certifcate and key?

I have following code:

import websocket

sslopt = {
    'check_hostname': False
}

ws = websocket.WebSocket(sslopt=sslopt)
ws = ws.connect('wss://domain.name/end-point/name')

print(ws.recv())

I works when I am connecting directly, to WebSocket server, but I need to connect to WebSocket server hidden behind nginx with SSL enabled.

0 Answers
Related