Closed ztittle closed 6 years ago
Just as an FYI, try this as its easier that than certificate/key in a byte array: https://github.com/HarringayMakerSpace/awsiot/blob/master/Esp8266AWSIoTExample/Esp8266AWSIoTExample.ino
@ztittle @torntrousers Created https://github.com/esp8266/Arduino/pull/4027 to fix this, please have a look.
@igrr the 15 sec default gets it working for me. Thanks.
https://github.com/esp8266/Arduino/blob/7df28582858e5a935c721d131064e6e3082edfe8/libraries/ESP8266WiFi/src/WiFiClientSecure.cpp#L356
I've been trying to connect to the AWS IOT MQTT endpoint, but it appears that the ESP 8266 chip takes longer than the hard-coded 5-second timeout to perform the TLS handshake. After increasing this value to a generous 30 seconds, I was able to successfully connect to AWS IOT.
For reference, I was using the example code listed on https://github.com/copercini/esp8266-aws_iot/blob/master/examples/MQTT_x509_bin/MQTT_x509_bin.ino, but loading the certs from PROGMEM so I would not run out of memory.
Could the timeout be made configurable through a #DEFINE or an overload on connect()? This would greatly help adoption when integrating to a secure MQTT service such as AWS IoT.
Debug output