How to debug Safari silently failing to connect to a secure WebSocket

前端 未结 2 1605
走了就别回头了
走了就别回头了 2020-12-06 18:25

When doing new WebSocket(\'ws://server/\'); Safari connects fine, but when using new WebSocket(\'wss://server/\'); it completely fails (returns a <

相关标签:
2条回答
  • 2020-12-06 18:53

    Where I've seen this, it means there is something wrong with the certificate (expired, incorrect domain, etc). Try connecting directly to the WebSockets server from Safari, i.e. https://wss_server:wss_port/. Safari should give you a better error message that way.

    When I had this problem while developing wsproxy as part of noVNC (HTML5 VNC client) it turned out I was using an IP for the server but the certificate was signed for a hostname.

    0 讨论(0)
  • 2020-12-06 18:54

    Sysadmin fiddling has revealed a fix: setting OpenSSL to SSLv3 by default kills Safari, but letting it pick its own SSL version (all) works fine.

    0 讨论(0)
提交回复
热议问题