/* * WebSocketClientSSLWithCA.ino * * Created on: 27.10.2019 * * note SSL is only possible with the ESP8266 * */ #include #include #include #include ESP8266WiFiMulti WiFiMulti; WebSocketsClient webSocket; #define USE_SERIAL Serial1 // Can be obtained with: // openssl s_client -showcerts -connect echo.websocket.org:443 0; t--) { USE_SERIAL.printf("[SETUP] BOOT WAIT %d...\n", t); USE_SERIAL.flush(); delay(1000); } WiFiMulti.addAP("SSID", "passpasspass"); while(WiFiMulti.run() != WL_CONNECTED) { delay(100); } webSocket.beginSslWithCA("echo.websocket.org", 443, "/", ENDPOINT_CA_CERT); webSocket.onEvent(webSocketEvent); } void loop() { webSocket.loop(); }