copercini / esp8266-aws_iot

Some examples using x.509 certificates and TLSv1.2 under Arduino IDE

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error -4

vivekscorp opened this issue · comments

WiFi connected
IP address:
192.168.0.148
Heap: 45744
Success to open cert file
cert loaded
Success to open private cert file
private key loaded
Heap: 40224
Attempting MQTT connection...pm open,type:2 0
failed, rc=-4 try again in 5 seconds
Attempting MQTT connection...failed, rc=-4 try again in 5 seconds

Cannot Connect to Device....Please guide !!

I have take this same error when I try to connect using port 443. Do you have support to connect using this port?

@junym there is a note on AWS site for port 443: Clients wishing to connect using MQTT with X.509 Client Certificate authentication on port 443 must implement the Application Layer Protocol Negotiation (ALPN) TLS extension and pass x-amzn-mqtt-ca as the ProtocolName in the ProtocolNameList. Note that ALPN is not required to open connections using MQTT with X.509 Client Certificate authentication on port 8883.

source: https://docs.aws.amazon.com/iot/latest/developerguide/protocols.html

Another alternative is use MQTT + WebSocket on port 443 from here: https://github.com/odelot/aws-mqtt-websockets

@copercini Thanks for reply , Valeu :D 👍