- Newest
- Most votes
- Most comments
Hi team,
Unfortunately, AWSIotMqttManager itself doesn't provide a specific exception for certificate expiration or revocation. However, you can deduce it from the exceptions thrown during connection attempts: 1. states that AWS IoT denies connections with expired or revoked certificates. When a connection fails due to a certificate issue, AWSIotMqttManager throws a generic AmazonClientException 2. To identify if the cause is an expired or revoked certificate, you need to analyze the exception chain for an SSLHandshakeException. This exception usually signals a problem with the certificate, such as expiration or revocation1.
Here's how you can approach this:
Implement an MqttStatusCallback to monitor the connection status. When onStatusChanged is invoked with a status other than AWSIotMqttClientStatusCallback.Connected, check if the throwable parameter is an instance of AmazonClientException. If it is, traverse the exception chain by examining the cause of each exception until you find an SSLHandshakeException. This indicates a potential certificate issue.
Remember that this approach relies on inferring the certificate problem from the exception chain. AWSIotMqttManager doesn't explicitly provide distinct exceptions for certificate expiration and revocation.
answered 2 years ago
Relevant content
asked 5 years ago
