Skip to content

Commit

Permalink
改进:现在只会自动信任本地的不安全证书
Browse files Browse the repository at this point in the history
  • Loading branch information
iamapig120 committed Apr 15, 2019
1 parent c9248fc commit 164decf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'

server.get('*', Util.processRequest)

electronApp.commandLine.appendSwitch('ignore-certificate-errors')
// electronApp.commandLine.appendSwitch('ignore-certificate-errors')

electronApp.commandLine.appendSwitch(
'autoplay-policy',
'no-user-gesture-required'
Expand All @@ -127,8 +128,14 @@ electronApp.on('window-all-closed', () => {
electronApp.on(
'certificate-error',
(event, webContents, url, error, certificate, callback) => {
event.preventDefault()
callback(true) // eslint-disable-line standard/no-callback-literal
if (
certificate.fingerprint === '8f27c5f7a0a209da7948db0d2fcd42bac89a1005'
) {
event.preventDefault()
callback(true) // eslint-disable-line standard/no-callback-literal
} else {
callback(false)
}
}
)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "majsoul-plus-client",
"version": "1.12.0-beta.3",
"version": "1.12.0-beta.4",
"productName": "Majsoul Plus",
"author": "MajsoulPlus Team",
"description": "Majsoul Plus",
Expand Down

0 comments on commit 164decf

Please sign in to comment.