websocket._exceptions.WebSocketProxyException: failed CONNECT via proxy status: 503

北城以北 提交于 2019-12-10 12:37:30

问题


Provided answer need some more details regarding authentication with qlik server

I'm trying to connect to qlik using certificates through WebSockets.

Error:

websocket._exceptions.WebSocketProxyException: failed CONNECT via proxy status: 503

Code:

from websocket import create_connection  
import ssl  


senseHost = "dummy.xyz.com"  
privateKeyPath = "C:\\ProgramData\\Qlik\\Sense\\Repository\\Exported Certificates\\"  


## userDirectory and userId can be found at QMC -> Users  
userDirectory, userId = "DIRECTORY_OF_SERVER","QlikServerUserId"  


url = "wss://" + senseHost + ":4747/app/"  # valid  
certs = ({"ca_certs": privateKeyPath + "root.pem",  
            "certfile": privateKeyPath + "client.pem",  
            "keyfile": privateKeyPath + "client_key.pem",  
            "cert_reqs":ssl.CERT_REQUIRED,  
            "server_side": False  
            })  
ssl.match_hostname = lambda cert, hostname: True  
ws = create_connection(url, sslopt=certs,
                       http_proxy_host="xyz.corp.company.com",
                       http_proxy_port="80",
                       http_no_proxy="*.corp.company.com;*.abc.com;*.pqr.com;"
                       header={'X-Qlik-User: UserDirectory=%s; UserId=%s'% (userDirectory, userId)})  
session = self.ws.recv()

*Note:

  • My network has a proxy.
  • I have used the right values in every field like sensehost, userDirectory, userId

Please help or any suggestions can be appreciated to connect qlik.

Final aim: To get Qlik KPI values/charts into fronted developed by django dynamically!


回答1:


Partial Answer:

According to Qlik .net SDK documentation, they said Port: With proxy (443), without proxy (4747) or without security (80).

So, I changed url = "wss://" + senseHost + ":4747/app/" to url = "wss://" + senseHost + ":443/app/"

Pending:

Not able to login by using certificates. I want to use NTLM authentication. How to pass NTLM authentication to websocket link in python.

Please edit or write a new answer, if you are having a solution which can solve both issues.



来源:https://stackoverflow.com/questions/54586749/websocket-exceptions-websocketproxyexception-failed-connect-via-proxy-status

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!