MQTT 브리징에 대한 도움이 필요합니다. 현재 로컬 MQTT를 Watson IOT 메시징에 성공적으로 연결할 수 있지만 inscure 모드에서만 가능합니다. 1883 포트. 그래서이 명령으로 서버 인증서를 얻었습니다.지역 모기와 Watson-iot 사이의 안전한 다리
openssl s_client -connect myorg.messaging.internetofthings.ibmcloud.com:8883 -showcerts > server.crt
위의 두 줄과 아래에서 두 줄을 제거했습니다. 이 연결을 보안 모드로 시도하면 아래와 같은 소켓 오류가 발생합니다. 누구든지이 일을 도와 줄 수 있습니까?
mosquitto.conf
connection bridge-to-watsoniot bridge_insecure false bridge_certfile /home/pi/server.crt address myorg.messaging.internetofthings.ibmcloud.com:8883 cleansession false try_private false bridge_attempt_unsubscribe false notifications true notification_topic iot-2/type/Raspberry/id/my_mqtt_gateway/evt/status/fmt/raw remote_username use-token-auth remote_password *************** remote_clientid g:myorg:Raspberry:my_mqtt_gateway topic iot-2/type/+/id/+/cmd/+/fmt/+ in iot-2/type/+/id/+/cmd/+/fmt/+ topic iot-2/type/+/id/+/evt/+/fmt/+ out iot-2/type/+/id/+/evt/+/fmt/+ connection_messages true
mosqutto.log
1487240737: mosquitto version 1.4.10 (build date Thu, 25 Aug 2016 10:12:09 +0100) starting 1487240737: Config loaded from mosquitto.conf. 1487240737: Opening ipv4 listen socket on port 1883. 1487240737: Opening ipv6 listen socket on port 1883. 1487240737: Connecting bridge bridge-to-watsoniot (myorg.messaging.internetofthings.ibmcloud.com:8883) 1487240738: New connection from 127.0.0.1 on port 1883. 1487240738: New client connected from 127.0.0.1 as mqttjs_93a3961c (c1, k10, u'foo'). 1487240738: New connection from 127.0.0.1 on port 1883. 1487240738: New client connected from 127.0.0.1 as mqttjs_618c88ab (c1, k10). 1487240739: Socket error on client local.g:myorg:Raspberry:my_mqtt_gateway, disconnecting. 1487240747: New connection from 192.168.82.130 on port 1883.
IoT 인증서는 openssl 명령으로 얻은 것과 일치하는지 확인하려면 여기에서 다운로드 할 수 있습니다. https://github.com/ibm-watson-iot/iot-python/blob/master/src/ibmiotf/messaging.pem – ValerieLampkin
나는 내 파일과 비교해 내 파일에서 3 개의 인증서 중 하나가 누락되었음을 발견했습니다. 감사합니다. 포인터 도움이되었습니다. –