Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I upgraded nodejs to LTS version 12.14.1, this version has a more strict SSL control which i cannot pass when attempting to make a POST request.
The POST request:
function PostReq() {
let chunks = [], resData = '';
const postData = decodeURIComponent(qs.stringify({
property1: 'value1',
property2: 'value2'
}));
const options = {
headers: {
host: 'api.example.com',
path: '/endpoint/base/resource',
port: 443,
method: 'POST',
'Content-Type': 'application/x-www-form-urlencoded;',
'Content-Length': Buffer.byteLength(postData),
}
};
const reqPost = https.request(options, (res) => {
res.setEncoding('utf8');
if (res.statusCode === 200) {
console.log('got successfull http response');
res.on('data', (chunk) => {
console.log('getting chunks...');
chunks.push(chunk);
});
res.on('end', () => {
resData = Buffer.concat(chunks).toString();
console.log('response body data: ', resData);
});
} else {
console.error('received http status code: ', res.Statuscode);
}
});
reqPost.write(postData);
reqPost.on('error', (err) => {
console.error('HubSpot API Oauth error: ', err);
});
reqPost.end();
}
PostReq();
Error message:
Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames: Host: api.example.com. is not in the cert's altnames: mydomain.com, DNS:www.mydomain.com
at Object.checkServerIdentity (tls.js:283:12)
at TLSSocket.onConnectSecure (_tls_wrap.js:1331:27)
at TLSSocket.emit (events.js:223:5)
at TLSSocket._finishInit (_tls_wrap.js:794:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:608:12) {
reason: "Host: api.example.com. is not in the cert's altnames: mydomain.com, DNS:www.mydomain.com"
The stack:
Ive tried setting the NPM configuration setting ssl-strict to false but it didnt help. There is an solution that probably works, which is setting rejectUnauthorized value to false in the tls.connect() parameter but this causes serios security issues which im trying to avoid so id be grateful if anyone knows about a solution.
bpdsksrtmj
Niketan Sharma
819167b5336c456e9ad38395fec1c5
SarkariResultht
e3002a14a547406799fe27a6abf211
9e483d26583f44f6bafe369a29b405
keneucker
keneucker
Shamoil Khan
Frederik
f25932a0b984430fb48c4256f1aaad