This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF91 How to use Google's primary and backup root CA on the modem?

Hi,

I want to connect to Google Cloud IoT with a modified asset_tracker and want the TLS done by the modem like in asset_tracker.

Google has a primary and a backup root CA for IoT and they may switch between the primary and backup certificates at any time without notice

See here cloud.google.com/.../mqtt-bridge

Is it enough to install these certificates (in the right converted form) as type 0 with different sec_tags on the modem?

I hope :)

With kind regards,

Árpád

Parents Reply Children
  • Hi ,

    Thanks for confirming that you've gotten it to work. Can you clarify if you've put 3 certs (both of the minimal root CA set certs + the device cert) and the client private key into a single sec_tag? 

    I converted each of the Google minimal certs like this: 

    openssl x509 -inform DER -outform PEM -in gtsltsr.crt -out gtsltsr.pem

    I programmed the certs using the nRF91 device cred utility:

    python3 cred.py \
        --CA_cert gtsltsr.pem \
        --CA_cert GSR4.pem \
        --client_cert my_device-cert.pem \
        --client_private_key my_device-private.pem \
        --sec_tag 202 \
        --program_app <path-to-my-app>/build/zephyr/merged.hex
    

    I'm running the code from the google_iot_mqtt sample, called after the modem comes up. I removed the added globalsign.inc cert from the example code. SNTP is successful. DNS resolve for mqtt.2030.ltsapis.goog:8883 is successful.

    If I include both Google minimal CA certs (plus the device cert and key) in one sec_tag, I get `could not connect, error -111`.

    If I include only the primary cert `gtsltsr.pem` (plus the device cert and key) in one sec_tag, then I get `MQTT connect failed 5`.

    If I create separate sec_tags for each of the minimal certs, and another sec_tag for the device cert + key, and reference all 3 sec_tags, I also get `MQTT connect failed 5`.

    Thanks,
    Jeffrey

  • Hi Jeffery, I'm not familiar with the cred utility, I used modem_key_mgmt_write() programatically.

    I used 2 different tags for the certs - i.e., only 2 certs (primary and backup).

Related