Node.js windows 8 datetime不正确,使用GMT

时间:2015-05-23 03:12:54

标签: windows node.js datetime authentication azure

我尝试使用this microsoft azure node.js SDK来处理blob存储并简单地上传文件。

当我在Windows 7计算机上运行相同的代码时,该服务能够正确验证并上传图像。 Windows 8机器和Windows 7机器都在运行节点v.0.12.2,但是Windows 8机器生成的请求日期标题周围的错误太旧了。好像它使用我的系统时间作为GMT而天蓝色的服务在我的时区或其他地方进行身份验证?

代码:

var azure = require('azure-storage');
var blobService = azure.createBlobService(myStorageAccount, myAccessKey);
blobService.createContainerIfNotExists('testzies', {publicAccessLevel : 'blob'}, function(error, result, response){

});
blobService.createBlockBlobFromLocalFile('testzies', 'first', 'C:/temp/sample.jpg', function(error, result, response){

});

错误,仅在Windows 8机器上:

  

{[错误:禁止]} {[错误:服务器无法验证   请求。确保形成Authorization标头的值   正确包括签名。代码:' AuthenticationFailed',
  authenticationerrordetail:'请求日期标题太旧:\'星期五,5月22日   2015 02:56:35 GMT \'',statusCode:403}

1 个答案:

答案 0 :(得分:0)

我找到了自己的问题的答案here

  • 双击右下角的时钟
  • 更改日期和时间设置 - > “互联网时间”标签 - > “更改设置”
  • 将互联网时间服务器更改为“time.nist.gov”(我的设置为“time.windows.com”)