I am getting the weirdest error when attempting to call a DRS API -
Error: write EPROTO 101057795:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:794
I'm using node.js.. here's a peek at the code:
const https = require('https'); var options = { hostname: 'dash-replenishment-service-na.amazon.com', port: 443, path: '/subscriptionInfo', method: 'GET', headers: {'Authorization' : 'Bearer (' + item.Access_Token + ')', 'x-amzn-accept-type': 'com.amazon.dash.replenishment.DrsReplenishResult@1.0', 'x-amzn-type-version': 'com.amazon.dash.replenishment.DrsReplenishInput@1.0'} }; var req = https.request(options, (res) => { console.log('statusCode:', res.statusCode); console.log('headers:', res.headers); res.on('data', (d) => { process.stdout.write(d); }); }); req.on('error', (e) => { console.log("we have a error"); console.error(e); }); req.end();