没有CA证书的适用于Python的AWS IoT设备SDK

时间:2018-10-11 19:53:20

标签: python amazon-web-services aws-iot

是否可以使用AWS Access Key ID和AWS Secret Access Key通过不带CA证书的适用于Python的AWS IoT设备SDK通过websocket连接到MQTT吗?我可以在javascript应用程序和java应用程序中以这种方式工作,我想知道Python是否也可以吗?

from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient

clientId = "my-client-id"
clientEndpoint = "my-client-endpoint"
accessKeyId = "my-access-key-id"
secretAccessKey = "my-secret-access-key"

myAWSIoTMQTTClient = AWSIoTMQTTClient(clientId, useWebsocket=True)
myAWSIoTMQTTClient.configureEndpoint(clientEndpoint, 443)
myAWSIoTMQTTClient.configureIAMCredentials(accessKeyId, secretAccessKey)
myAWSIoTMQTTClient.connect()

连接超时。可能是因为我的路由器不允许IPv6(read here)。我尝试了this work around,但它仍然无法正常工作,因为它似乎需要CA证书。

我实际上想做的是可能的吗?

0 个答案:

没有答案