FleetProvisioningSample预调配生成证书没有响应 #375
-
我用的官方示例FleetProvisioningSample预置设备但是我通过IotIdentityClient#PublishCreateKeysAndCertificate发出生成证书的请求($aws/certificates/create/json)之后没有成功的响应($aws/certificates/create/json/accepted)也没有拒绝的响应($aws/certificates/create/json/rejected)启动参数:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
Hi ArvinSpace, Looking at the logs and the information provided, my guess is that the sample is trying to connect and access a resource that it is not authenticated to add, as the disconnect seems to happen right after the connect attempt, according to the logs. Looking at the Fleet-Provisioning sample, I noticed the policy you have provided is missing a few items compared to the one shown in the sample README: {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "iot:Publish",
"Resource": [
"arn:aws:iot:region:account:topic/$aws/certificates/create/json",
"arn:aws:iot:region:account:topic/$aws/certificates/create-from-csr/json",
"arn:aws:iot:region:account:topic/$aws/provisioning-templates/templatename/provision/json"
]
},
{
"Effect": "Allow",
"Action": [
"iot:Receive"
],
"Resource": [
"arn:aws:iot:region:account:topic/$aws/certificates/create/json/accepted",
"arn:aws:iot:region:account:topic/$aws/certificates/create/json/rejected",
"arn:aws:iot:region:account:topic/$aws/certificates/create-from-csr/json/accepted",
"arn:aws:iot:region:account:topic/$aws/certificates/create-from-csr/json/rejected",
"arn:aws:iot:region:account:topic/$aws/provisioning-templates/templatename/provision/json/accepted",
"arn:aws:iot:region:account:topic/$aws/provisioning-templates/templatename/provision/json/rejected"
]
},
{
"Effect": "Allow",
"Action": [
"iot:Subscribe"
],
"Resource": [
"arn:aws:iot:region:account:topicfilter/$aws/certificates/create/json/accepted",
"arn:aws:iot:region:account:topicfilter/$aws/certificates/create/json/rejected",
"arn:aws:iot:region:account:topicfilter/$aws/certificates/create-from-csr/json/accepted",
"arn:aws:iot:region:account:topicfilter/$aws/certificates/create-from-csr/json/rejected",
"arn:aws:iot:region:account:topicfilter/$aws/provisioning-templates/templatename/provision/json/accepted",
"arn:aws:iot:region:account:topicfilter/$aws/provisioning-templates/templatename/provision/json/rejected"
]
},
{
"Effect": "Allow",
"Action": "iot:Connect",
"Resource": "arn:aws:iot:region:account:client/test-*"
}
]
} Can you see if adding these additional fields in the above policy to your policy helps fix the issue? If that does not fix the issue, can you try using a fully permissive policy, just to help confirm whether or not policy permissions are causing the issue. A fully permissive policy is not ideal for production use cases, but for testing to determine if the policy is causing issues it can be helpful. A fully permissive policy is shown below: {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"iot:*"
],
"Resource": "*"
}
]
} Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
I've been looking into this further and been trying all sorts of things, but have been largely unsuccessful at recreating the issue. I have tried making a new Fleet Provisioning template following the sample README, trying all sorts of invalid data possibilities, and trying different policy combinations. In all but one case (more below) I would either be able to run the sample successfully without issue or I would get an error (like expected) but it would be properly reported via the
RejectedThingRequest
callback.The only time I got something similar to what you are seeing in this issue is if I used an IoT Policy attached to the IoT Thing that I pass the
--cert
and--key
to that mirrors …