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?

已提問 1 年前檢視次數 239 次
1 個回答
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
專家
Greg_B
已回答 1 年前
  • 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"
    

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南