2017-09-05 41 views
0

在下面的代碼中,iot.listCertificates執行完美,我能夠在AWS IOT控制檯中看到所有證書,但是當我嘗試執行命令iot.createKeysAndCertificate時,它會給我提供NETWORK FAILURE ERROR。AWS IOT createKeysAndCertificate給出網絡失敗錯誤

請幫我這個, 謝謝!

var params = {}; 
iot.listCertificates(params, function(err, data) { 
    if (err) console.log(err, err.stack); // an error occurred 
    else  console.log(data);   // successful response 
}); 
alert("Attempting to create new thing!!"); 
params = { 
    setAsActive:false 
}; 
iot.createKeysAndCertificate(params, function(err, data) { 
    if (err) 
     alert(err); 
    else 
     alert("New thing added to AWS IOT"); 
}); 

回答

0

我剛剛在瀏覽器(Chrome 61)中試過了上面的代碼,它成功地列出了證書並創建了新的證書。所以不要認爲問題出在你的代碼上。

也許嘗試確保時鐘在您提出請求的機器上正確。由於時鐘關閉了幾分鐘,我看到一些AWS請求失敗。他們也可能使用請求中的時間在證書上生成到期日期。

相關問題