I get an "ERR_INVALID_CERT_AUTH" error when an axios POST call is made. I tried to provide the root certificate string in httpsAgent but still get the same error. Please let me know what I might be doing wrong and how to fix it. The certificate was issued by CACert. Appreciate your help.
const caCrt = '<Certificate string>';
const httpsagent = new https.Agent({ ca: caCrt, keepAlive: false });
axios({
method: 'post',
url: urltocall,
httpsAgent: httpsagent,
data: JSON.stringify(inputJson),
config: {
headers: {
'Access-Control-Allow-Origin': 'http://localhost:1337',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
}
})
.then(function (response) {
new Vue({
components: { Home },
render: h => h(Home, {
props: {
username: 'test
}
})
}).$mount('#app');
})
.catch(function (error) {
alert(error);
});