Using `curl` to check a TLS certificate on a websocket (`ws` or `wss`)
Checks the TLS cert on the connection:
curl -v \
--insecure \
--include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: example.com:80" \
--header "Origin: http://example.com:80" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
"https://example.com:4000/socket.io/?EIO=3&transport=websocket" 2>&1| awk 'BEGIN { cert=0 } /^\* Server certificate:/ { cert=1 } /^\*/ { if (cert) print }'