Cert Revoked when calling API to my server with self signed cert

Viewed 362

I'm using Axios in ReactJS to call my API that is hosted on the cloud with a self-signed certificate. The error for the request returns net::ERR_CERT_REVOKED.

I've added the self-signed code to my login keychain on MacOS running reactjs. But the cert is still getting revoked when I view the error on the logs on Chrome. On safari, the error is Failed to load resource: The certificate for this server is invalid.

try {
        const response = await axios.post(
            'https://1.1.1.1:3000/login',
            { withCredentials: true },
            { auth: apiAuth },
            { data: bodyFormData },
            { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }
          )
          return response.data;
    } catch (error) {
        console.log(error);
    }

IP address has been changed for the question.

I've tried to use the following code in the Axios request but it doesn't help

const agent = new https.Agent({  
  rejectUnauthorized: false
});

Expected the server to give a response but getting cert revoked as response.

1 Answers

self-signed certificate ... net::ERR_CERT_REVOKED ... MacOS

You probably run into the new requirements for certificates in MacOS 10.15 and iOS 13 which seem to be enforced also for self-signed certificates. While you don't provide any details about your specific certificate I guess it is valid for more than 825 days. It might of course also be any other of the new requirements - see Requirements for trusted certificates in iOS 13 and macOS 10.15 for the details.

Related