I am calling aws with async call and I'm getting this. <![CDATA["Signature expired: 20171114T190104Z is now earlier than 20180323T213705Z (20180323T214205Z - 5 min.)"]]>
.
sI know that this is most likely caused by my machine having the clock off, but how do I fix it? The time is set to be determine automatically like so.
I'm using Fedora.
This answer suggested that the AWS keys might be timing out(?) (I don't fully understand this one). If that's the case how do I fix this? I tried manually changing my clock both -5min and +5min, as suggested by the error, but it didn't do anything.
Edit: The same error appears when using a live heroku server.
Edit2: I'm using Node Express and making the call like this:
function(callback) {
// third call
var results = '';
var options = {
host: urlObject.host,
protocol: urlObject.protocol,
path: urlObject.path,
headers: {
Authorization: `AWS4-HMAC-SHA256 Credential=key/20171114/us-west-1/awis/aws4_request, SignedHeaders=host;x-amz-date, Signature=key`,
'Content-Type': 'application/xml',
'X-Amz-Date': '20171114T190104Z',
Accept: 'application/xml',
},
};
https.get(options, resource => {
resource.setEncoding('utf8');
resource.on('data', function(data) {
// results += JSON.parse(data);
results += data;
});
resource.on('end', function() {
callback(null, results);
});
resource.on('error', function(err) {
callback(err);
});
});
},