-2
I made an Node application (v12.14.1) to access a webservice. It has Basic Authentication.
const uname = "xxxxxxxxx";
const pass = "%$7675845353525$%";
const p_cpf = "97856353424";
const p_senha = "xxx1111";
const myurl = "https://defesaagropecuaria.sp.gov.br/api/servicos/login";
const updateUser = async () => {
try {
const res = await axios.put(myurl, {
cpf: p_cpf,
senha: p_senha,
auth: {
username: uname,
password: pass
}
});
console.log(res.data.token);
} catch (err) {
console.log(err);
}
};
When executing occurs the following error:
Error: write EPROTO 5300:error:1425F102:SSL routines:ssl_choose_client_version:Unsupported Protocol:c: Ws deps openssl openssl ssl statem statem_lib. c:1929:
What could be going on? From what I researched this is related to the minimum version of Node, but I could not figure out how to set this in my code. I would also like to know if it is correct the way I am passing the parameters (it asks Cpf and the user password and the Basic authentication)
Try to spin your
node
with the argument--tls-min-v1.0
– Sorack