Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mqtt_azure example uses the Baltimore certificate #73281

Closed
uriel-kluk opened this issue May 24, 2024 · 5 comments · Fixed by #73557
Closed

mqtt_azure example uses the Baltimore certificate #73281

uriel-kluk opened this issue May 24, 2024 · 5 comments · Fixed by #73557
Assignees
Labels
area: Networking bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@uriel-kluk
Copy link

uriel-kluk commented May 24, 2024

Summary

Azure IoT Hub and Device Provisioning Service (DPS) use TLS certificates issued by the Baltimore CyberTrust Root, which expires in 2025. Starting in February 2023, all IoT hubs in the global Azure cloud will migrate to a new TLS certificate issued by the DigiCert Global Root G2.

Details

The example provided conatins a file named digicert.cer, but it contains the Baltimore CyberTrust Root. The solution should include DigiCert Global Root G2 instead.

Reproduce

  1. Run the example as is, entering the username, password, and hostname in the configuration.
  2. Observe the following error:
[00:00:11.336,000] <dbg> mqtt_azure: try_to_connect: attempting to connect...
[00:00:11.401,000] <err> net_sock_tls: Failed to parse CA certificate, err: -0xfffffffe
  1. Replace the certificate using the certificates provided here.
  2. Observe that the same error persists.
  3. Change the certificate to include only the DigiCert Global Root G2.
  4. Observe the new error:
[00:00:16.308,000] <dbg> mqtt_azure: try_to_connect: attempting to connect...
[00:00:16.420,000] <err> net_sock_tls: TLS handshake error: -0x7280
[00:00:16.430,000] <err> mqtt_azure: mqtt_connect failed -113

Impact

It might be my configuration that is failing, but if developers base their code on the example provided, devices will stop connecting in 2025.

@uriel-kluk uriel-kluk added the bug The issue is a bug, or the PR is fixing a bug label May 24, 2024
Copy link

Hi @uriel-kluk! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

@rlubos
Copy link
Contributor

rlubos commented May 28, 2024

Thanks for the report, it seems that for the time being it'd be most reasonable to support both certificates.

As for the issues with Baltimore CyberTrust Root certificate registration, there's been a lot of happening recently in mbed TLS area, and it seems one of the PRs (#72078 specifically) might've affected the sample. Baltimore CyberTrust Root uses sha1WithRSAEncryption as a signature algorithm, and SHA1 is no longer enabled by default. Can you check if it works for you after enabling CONFIG_MBEDTLS_MAC_SHA1_ENABLED=y in the prj.conf file?

As for the failures with DigiCert Global Root G2, I guess the Azure transition is not complete, so it could be possible that we'd still need Baltimore for your case?

Feel free to send a PR if it helps in your case. We could also add the second certificate if such a configuration works for you.

@uriel-kluk
Copy link
Author

uriel-kluk commented May 28, 2024 via email

@rlubos
Copy link
Contributor

rlubos commented May 31, 2024

I've opened #73557 with the fixes discussed.

@uriel-kluk
Copy link
Author

uriel-kluk commented May 31, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Networking bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants