簡體   English   中英

連接到AWS IOT的證書配置參數問題

[英]Certificate configuration parameter problems connecting to AWS IOT

試圖讓我的node.js IOT示例正常工作,但不確定要傳遞給我的thingShadow構造函數awsIot.thingShadow(config)需要設置什么配置

這是我從AWS儀表板獲得的示例配置

{
  "host": "foo.iot.us-east-1.amazonaws.com",
    "port": 8883,
    "clientId": "bar",
    "thingName": "bar",
    "caCert": "root-CA.crt",
    "clientCert": "bar-certificate.pem.crt",
    "privateKey": "bar-private.pem.key"
}

但是這是我根據sdk自述文件設置的構造函數

{
  keyPath: 'bar-private.pem.key',
  certPath: 'bar-certificate.pem.crt',
  caCert: "root-CA.crt",
  clientId: 'bar'
}

我得到錯誤

events.js:141 throw er; //未處理的“錯誤”事件^

Error: unable to get local issuer certificate
    at Error (native)
    at TLSSocket.<anonymous> (_tls_wrap.js:1017:38)
    at emitNone (events.js:67:13)
    at TLSSocket.emit (events.js:166:7)
    at TLSSocket._init.ssl.onclienthello.ssl.oncertcb.TLSSocket._finishInit (_tls_wrap.js:582:8)
    at TLSWrap.ssl.onclienthello.ssl.oncertcb.ssl.onnewsession.ssl.onhandshakedone (_tls_wrap.js:424:38)

caCert基於什么-是我在本地路徑中擁有的證書嗎? 如果是這樣,我可以從哪里下載儀表板呢? 我是否可以為privateKey發送正確的證書文件?

因此,問題在於root-CA.crt文件。 我在aws庫的node_modules目錄中找到了我的,這是無效的。

我需要從https://www.symantec.com/content/zh-cn/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem獲取crt文件

如本文檔所述, http://docs.aws.amazon.com/iot/latest/developerguide/iot-device-sdk-node.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM