ESP8266_NONOS_SDK/tools 目录下生成证书后,转化为头文件给 openssl_client 使用:
TODO: 证书校验失败原因定位。
cp_header.sh
#!/bin/bash
# set ca crt for use in the client
cp ca/ca.crt ./
cp client/client.crt ./
cp client/client.key ./
touch ssl_client_crt.h
xxd -i ca.crt | sed -e "s/ca_crt/ca_crt/" > ssl_client_crt.h
# set client crt for use in the client
xxd -i client.crt | sed -e "s/client_crt/client_crt/" >> ssl_client_crt.h
# set private key for use in the client
xxd -i client.key | sed -e "s/client_key/client_key/" >> ssl_client_crt.h
#cp ssl_client_crt.h ~/githubesp/ESP8266_RTOS_SDK/examples/mqtt_demo/include/
cp ssl_client_crt.h ~/esp/ESP8266_RTOS_SDK/examples/mqtt_demo/include/
cp ssl_client_crt.h ~/esp/ESP8266_RTOS_SDK/examples/openssl_client/include/
rm ca.crt client.crt client.key ssl_client_crt.h