Overriding Self-Signed SSL Certificate Warnings with Electron

时间秒杀一切 提交于 2020-06-17 14:15:26

问题


There are two prior questions leading to this question (if you're interested):

  1. ssl-for-intranet-applications-deployed-at-multiple-companies
  2. distributing-ssl-certificates-to-all-browsers-in-an-active-directory-environment

In Electron, do you have the ability to override SSL certificate warnings that you'd typically get when using self-signed certificates via a modern web browser?

Typically, in desktop applications, you do not have to adhere to the strict online-banking-level certificate standards that web browsers warn about. The data I'm transferring isn't that sensitive.

As a matter of fact, one of the only reasons I'm moved my app from http to https, is because certain web standard APIs won't function unless the protocol is https. The Notification API is one example.

Otherwise, the data I'm transferring over intranet just isn't that sensitive. Yet, the browsers attempts to burden me (and my users) with Online-Banking-Level certificate authentication.

I'm trying to avoid this somehow and thought that maybe Electron could give me more client-side control for pre-approving my self-signed certificate. Is this doable in Electron?


回答1:


I have some trouble with https and untrusted proxy certificates and this in my index.js

// We have to deal with self-signed and therefore untrusted root certificates.
global.process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0';

It's an intranet application that never reaches out to the internet, so it's ok for me here.



来源:https://stackoverflow.com/questions/61961738/overriding-self-signed-ssl-certificate-warnings-with-electron

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!