Error connecting "CERTIFICATE_VERIFY_FAILED: certificate has expired"

Hi,

I am currently building Flutter applications with Dart and getting the following error:
client exception - HandshakeException: Handshake error in client (OS Error: CERTIFICATE_VERIFY_FAILED: certificate has expired(handshake.cc:393)

It is no problem on the Windows desktop app, but not on Android device.
Here is additional information:

  • Device: Galaxy Tab S2
  • OS: Android (7.0)
  • Dependency used in the Flutter project: mqtt_client: ^9.7.2

How can I solve this problem?

Thanks,

You can download the root certificate here .
This will create a file called “isrgrootx1.pem”, which you can use as “Server Certiciate”.

Hi @Daria_H ,

Thank you for the reply.
I tried and it is working well! Thank you! :slight_smile:

If I upgrade to the plan later, are we still using the same pem file?

Thanks,

Hi @sback2063 ,
Yes, you can use the same file. We keep the certificate file pinned in the Frequently Asked Questions topic here: Frequently Asked Questions.

Glad that it helped :+1:
Dasha from HiveMQ

How to use this file in our app?

Hi @ELIE

welcome to the HiveMQ Community! We’re excited to have you join us, especially because of your interest in MQTT and the HiveMQ broker. It’s great to see new users like you!

You asked “How to use this file in our app?”, however, did not specify what app it actually is. Can you elaborate on that?

Thanks,
Dasha from HiveMQ Team

Hello sir, I am building a Flutter app, and I got this error in my console: Exception caught by image resource service
Handshake error in client (OS Error: CERTIFICATE_VERIFY_FAILED: certificate has expired(handshake.cc:393))
So, how to resolve this error?

Hi @ELIE

Thanks for your reply! As I understand it so far, you are developing a Flutter app, which uses some sort of MQTT library to communicate to MQTT brokers.
Perhaps you could share a link to your app’s code and describe, how you run it, so I could reproduce the error that you are seeing. That could help investigate the issue further.
In case you are following instructions provided by HiveMQ, it would help, if you share the link to those instructions and indicate at which step it fails. I am sure we could get to the root of the issue together.

Thanks,
Dasha from the HiveMQ Team