Call Device Shadow RestAPI and authenticate TLS mutual authentication with a client certificate.

0

https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-rest-api.html As mentioned in document above: The Device Shadow service accepts two forms of authentication: Signature Version 4 with IAM credentials or TLS mutual authentication with a client certificate. How can we get client certificate? Is it the one I downloaded when create thing in IOT Core?

gefragt vor einem Jahr239 Aufrufe
1 Antwort
0

Hi. Yes that is one way to get a client certificate (and associated private key). And the easiest way when you're getting started.

Note that a device will typically use the MQTT topics (not the REST API) to interact with shadows: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html

If you use one of our IoT Device SDKs, they have shadow support (on the MQTT topics) built-in: https://docs.aws.amazon.com/iot/latest/developerguide/iot-sdks.html#iot-device-sdks

profile pictureAWS
EXPERTE
Greg_B
beantwortet vor einem Jahr
  • I am using postman to test API request to Device Shadow REST API. But got Forbidden error after config client certificate. If I using access keys and private keys, it works. Could you have any example using client certificate?

  • Here's how you do it with curl: https://docs.aws.amazon.com/iot/latest/developerguide/http.html

    curl --tlsv1.2 \
        --cacert Amazon-root-CA-1.pem \
        --cert device.pem.crt \
        --key private.pem.key \
        --request POST \
        --data "{ \"message\": \"Hello, world\" }" \
        "https://IoT_data_endpoint:8443/topics/topic?qos=1"
    

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen