Search code examples
websocketcertificate

How to read server certificate from wss endpoint?


I have websocket endpoint wss://http-testnet.hecochain.com/ to connect to, but I cannot get its certificate to use within code.

While to certificate for HTTP URL you can just use browser (See 1) and 2) below), there is no way for WS as it is not displayed in browser

Links


Solution

  • Well, because wss actually works over htttps port 443, so certificate is the same for wss:

    openssl s_client -connect http-testnet.hecochain.com:443 -showcerts

    openssl s_client -connect ws-testnet.hecochain.com:443 -showcerts