设备无法通过 Charles 代理连接到 AWS IoT Core

0

【以下的问题经过翻译处理】 我正在尝试通过Charles Proxy连接我的设备(Raspberry Pi 3 Model B)。

  1. 我在我的笔记本电脑上设置了Charles代理。
  2. 通过部署,我更新了Nucleus配置。
{
  "networkProxy": {
    "proxy": {
      "url": "http://192.168.0.38:8888"
    }
  }

  1. 按照启用设备信任HTTPS代理中所述,将Charles根证书添加到核心设备的Amazon根CA证书文件中。 **实际结果:**设备无法连接到AWS IoT Core。
2023-04-04T12:44:19.588Z [INFO] (pool-2-thread-12) com.aws.greengrass.mqttclient.AwsIotMqttClient: 正在连接AWS IoT Core。 {clientId=rpi_3_B}
2023-04-04T12:44:22.102Z [ERROR] (Thread-4) com.aws.greengrass.mqttclient.AwsIotMqttClient: 无法连接到AWS IoT Core。 {clientId=rpi_3_B}
software.amazon.awssdk.crt.mqtt.MqttException: socket is closed.
        at software.amazon.awssdk.crt.mqtt.MqttClientConnection.onConnectionComplete(MqttClientConnection.java:140)

2023-04-04T12:44:22.110Z [ERROR] (pool-2-thread-12) com.aws.greengrass.mqttclient.MqttClient: 从缓冲区发送时出错。 {}
java.util.concurrent.ExecutionException: software.amazon.awssdk.crt.mqtt.MqttException: socket is closed.
        at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
        at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
        at com.aws.greengrass.mqttclient.Mqtt
profile picture
EXPERTE
gefragt vor 6 Monaten42 Aufrufe
1 Antwort
0

【以下的回答经过翻译处理】 AWS IoT Greengrass使用TLS双向认证与AWS IoT core连接:https://docs.aws.amazon.com/greengrass/v2/developerguide/device-auth.html#:~:text=Communication%20between%20core%20devices%20and%20client%20devices%20and%20between%20devices%20and%20AWS%20IoT%20Core%20or%20AWS%20IoT%20Greengrass%20must%20be%20authenticated.%20This%20mutual%20authentication%20is%20based%20on%20registered%20X.509%20device%20certificates%20and%20cryptographic%20keys

TLS双向认证是基于已注册X.509设备证书和加密密钥进行相互认证。这种设计可以有效防止检查代理的工作,以确保安全。

您必须使用不会拦截和修改TLS连接的透明代理。此外,您必须设置代理为“http”,而不是“https”。如果代理本身的连接需要使用TLS,则应使用“https”。

祝愿您好运!

Michael

profile picture
EXPERTE
beantwortet vor 6 Monaten

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