I integrate JITR following this article.
https://aws.amazon.com/blogs/iot/just-in-time-registration-of-device-certificates-on-aws-iot/
I did all these steps and was able to authenticate the certificate through the command line 'mosquitto_pub'.
The first time I run the mosquitto_pub command, it calls the lambda function to authorize and attach the policy, and the second time it successfully posts a message to IOT.
Here is the command I'm using.
mosquitto_pub --cafile ../root.cert --cert hassanAndCACert.crt --key hassan.key -h <
-p 8883 -q 1 -t topic5 -i 123456789 --tls-version tlsv1.2 -m '{"hello":"3"}' -d
But when I try to authenticate this in the Android SDK, I get a “handshake” error. Here is the exception I am getting.
MqttException (0) - javax.net.ssl.SSLHandshakeException: Handshake failedat org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException (ExceptionHelper.java:38) in org.eclipse.paho.client.mqttv3. ClientComms $ ConnectBG.run (ClientComms.java:664) in java.lang.Thread.run (Thread.java:818) Raised: javax.net.ssl.SSLHandshakeException: com.android.org.conscrypt.OpenSSLSocketImpl connection confirmation failed. startHandshake (OpenSSLSocketImpl.java:441) in org.eclipse.paho.client.mqttv3.internal.SSLNetworkModule.start (SSLNetworkModule.java:93) in org.eclipse.paho.client.mqttv3.internal.ClientComms $ ConnectBG.run ( ClientComms.java:650) ... 1 moreCaused by: javax.net.ssl.SSLProtocolException: SSL acknowledgment terminated: ssl = 0xb91e9b40: SSL library failure, usually errorerror protocol: 100c5416: SSL routines: ssl3_read_bytes:SSLV3_ALERT_CERTIFICATE_UNKNOWN (external / boringssl / src / ssl / s3_pkt.c: 972 0xb9215530: 0x00000001) when com.android.org.conscrypt.NativeCrypto.SSL_do_handshake (Native Method) in com.androidOnshplpl.constsplpl.constsplpl.constsplpl.constsplpl.constsplpl.constsplpl.constsplpl.constsplpl.conpls.conplsconstsplcon.consclandspconstring java: 353)
, , android, . . , .
, mosquitto , , mosquitto , PAHO-MQTT AWS SDK , , 'connect'. AWS.