electron-ssl-pinning:在Electron中阻止中间人攻击

发表于 4年以前  · 总阅读数:2117 次

Electron SSL Pinning

Prevents MITM in Electron applications.

What? MITM?

Installation

npm install electron-ssl-pinning

Usage

Retrive pinning config using following command

fetch-ssl-pinning-config google.com

Then apply this config to Electron session.

const { session } = require('electron');
const { createSslVerificator } = require('electron-ssl-pinning');

session.defaultSession.setCertificateVerifyProc(
  createSslVerificator([
    {
      domain: '*.google.com',
      fingerprints: [
        'sha256/fyFMxrkFMkcRq9nDQimG8gq8136Vbrzm5pQSMhRH2Os=',
        'sha256/vgzNVNTOzaG9Xl2ezIWgTCwfk6UiDXf96I/prQgfZBs='
      ]
    }
  ])
);

License

Apache-2.0

 1个收藏

 1个关注

访问GitHub主页
 目录