Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

189
Vistas
Relaying api call gets rejected because relaying server's url is not in api's certs

I'm working on a api relay server that is supposed to log the requests and responses of api calls. Problem is when the server attempts to make an api call the api returns with status code 500 because the api's certs does not contain the relay server's url. I've made use of a https agent with options : {rejectUnauthorized: false} to bypass the authentication process. I saw that the host in the headers contains the server's url and I would like to know if I could modify the host to properly make authenticated api calls through the relay server.

Error when not using https agent:

Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames: Host: us-central1-apirelayserver.cloudfunctions.net. is not in the cert's altnames: DNS:*.company.services

API call:

const httpsAgent = new https.Agent({ rejectUnauthorized: false });
let headersJson = JSON.stringify(requestDocument.headers);
let axiosConfig = {headers: JSON.parse(headersJson),httpsAgent};
const info = await axios.post(requestDocument.apiBaseUrl.toString(),requestDocument.body,axiosConfig).catch(error => {
            console.log(error);
            console.log(error.response.body);
        });
response.status(200).send(info.data);
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda