Electronic certificate network

I am trying to write a simple electronic application for interacting with a REST server. There are no corresponding certificates on the server. When I try to make a "GET" request (using fetch ()), the following error message appears:

  Failed to load resource: net::ERR_BAD_SSL_CLIENT_AUTH_CERT

Committing certificates is currently not an option. I tried using the ignore-certificates-error flag (see below). It seems he should let me skip this error, but it is not.

var electron = require('electron');
var app = electron.app
app.commandLine.appendSwitch('ignore-certificate-errors');
...

The result is the same error.

Questions:

  • Am I suggesting that these options should help here?
  • If so, any ideas what am I doing wrong?

Electronic version: 1.2.8

Thank!

0
source share
1 answer

:

app.on('certificate-error', (event, webContents, link, error, certificate, callback) => {
  if ('yourURL/api/'.indexOf(link) !== -1) {
    // Verification logic.
    event.preventDefault();
    callback(true);
  } else {
    callback(false);
  }
});

api https.

0

Source: https://habr.com/ru/post/1689081/


All Articles