Simple Websocket Client using mbedtls tested on STM32F7
- Sending and Receiving encrypted websocket data
- No continuation frames
- Not parsing Server Handshake response
- No other Op Codes than "text"
- No random Nonce for handshake
Set up a Project for your STM32 Microcontroller with LWip and mbedTLS For example:
- https://github.com/STMicroelectronics/STM32CubeF4/tree/master/Projects/STM324x9I_EVAL/Applications/mbedTLS/SSL_Client
- https://github.com/anon767/STM32F7HTTPS
Also you need:
- openssl
- golang (for the test websocket server)
- Adjust the client.h
- In your main.c
#include client.h
and call
SSL_Client();
Somewhere in you main();
- Generate Cert/Key and build and start server
mkdir -p $GOPATH/src/github.com/anon767/wsserver
cp ./test_server.go $GOPATH/src/github.com/anon767/wsserver/wsserver.go
cd $GOPATH/src/github.com/anon767/wsserver
go get && go build
chmod +x wsserver
openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem
./wsserver
- Compile and Flash your device