philipparndt / mqtt-analyzer

Apache License 2.0
92 stars 6 forks source link

Feature request - Connection to AWS IoT #116

Closed zpm1066 closed 2 years ago

zpm1066 commented 2 years ago

Hi Philipp, I tried connecting to AWS IoT using MQTTAnalyzer with a p12 file created from a device's certificate & private key. It didn't work. I think if MQTTAnalyzer supplied the AWS CA certificate file, plus client certificate & key files (also AWS IoT Endpoint address & ClientID), it would work.

Is there a way currently to supply all these files as part of the connection? If not, as an enhancement to MQTTAnalyzer, it would be great. Please consider. Thank you for your efforts. Much appreciated!

philipparndt commented 2 years ago

Hi @zpm1066,

AWS IoT is working for me with a p12 certificate file. I think I will need a more detailed description on how to work with certificate files. To to this I will need to setup more integration tests.

zpm1066 commented 2 years ago

Please share the openssl command that you have used to generate the p12 file.

I have used the openssl command with a known client (ESP32 working with AWS IoT) certificate & private key plus AWS CA certificate but my p12 doesn't work. Quite likely I'm not using the correct openssl commands. Thanks.

philipparndt commented 2 years ago

this is already mentioned in the documentation. You can find it here: https://github.com/philipparndt/mqtt-analyzer/blob/master/Docs/AWS-IoT.md#connect-to-aws-iot

I've just updated the document to match the lastest version of the AWS IoT page and added some more details.

The command to create p12 files is also part of the certificate selection page directly in the app 😉

zpm1066 commented 2 years ago

Thanks for the additional note you've added to the AWS docs. However, MQTTAnalyzer still doesn't work for me when I attempt connection to AWS IoT. Using a p12 file with MQTTAnalyzer (iOS 15.3.1) fails with error Socket closed by remote peer. The same certificates (AWT CA, AWS device, and AWS device private key) work fine with my ESP32 clients. Also, I'm able to use MQTT.fx on macOS to AWS IoT without any problems. So, not quite sure why MQTTAnalyzer fails. Any suggestions?