Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0.0] Crash when https certificate has error #22103

Closed
3 tasks done
KagamiChan opened this issue Feb 8, 2020 · 7 comments
Closed
3 tasks done

[8.0.0] Crash when https certificate has error #22103

KagamiChan opened this issue Feb 8, 2020 · 7 comments

Comments

@KagamiChan
Copy link
Contributor

KagamiChan commented Feb 8, 2020

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    • 8.0.0
  • Operating System:
    • Windows 10 (1910)
  • Last Known Working Electron version:
    • 7.1.11

Expected Behavior

Should not crash when certificate has error

Actual Behavior

Crashes with error code 3221225477

To Reproduce

Code for repro: https://github.com/KagamiChan/electron-quick-start/tree/https-err

The only change is:

diff --git a/main.js b/main.js
index e366d5b..7845945 100644
--- a/main.js
+++ b/main.js
@@ -13,7 +13,7 @@ function createWindow () {
   })

   // and load the index.html of the app.
-  mainWindow.loadFile('index.html')
+  mainWindow.loadURL('https://blog.kagami.moe/')

   // Open the DevTools.
   // mainWindow.webContents.openDevTools()
  1. run npm start
  2. the Electron app crashes with the page at https://blog.kagami.moe/, which has certificate error
npm run start

> electron-quick-start@1.0.0 start C:\Users\kagami\dev\electron-quick-start
> electron .


(electron) The default value of app.allowRendererProcessReuse is deprecated, it is currently "false".  It will change to be "true" in Electron 9.  For more information please check https://github.com/electron/electron/issues/18397
npm ERR! code ELIFECYCLE
npm ERR! errno 3221225477
npm ERR! electron-quick-start@1.0.0 start: `electron .`
npm ERR! Exit status 3221225477
npm ERR!
npm ERR! Failed at the electron-quick-start@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\xxx\AppData\Roaming\npm-cache\_logs\2020-02-08T13_47_44_708Z-debug.log

Screenshots

Additional Information

This seems highly similar to #21597 as the error code is the same
also maybe #22030 is relevant but it won't crash when first having an cert error

@simongregory
Copy link

I'm also seeing a crash on the first fetch our Electron app makes from a renderer to establish network access, there's no exit status like above, nor useful errors thrown.

Switching from https to http avoids the crash.

Latest Chrome reports a NET::ERR_CERT_COMMON_NAME_INVALID if used to visit the same endpoint.

Network wise, a wifi login re-direct causes the issue - ie there's a LAN connection but no WAN because all requests are being routed to a login page. Version details are the same as above but using a Mac running 10.15.

@simongregory
Copy link

In our case the crash is avoided by calling calling preventDefault() on app certificate-error, ie:

app.on('certificate-error', (event) => {
  event.preventDefault()
});

@nornagon
Copy link
Member

Maybe also relevant: #21973, which was fixed by #21976 in master. I assumed that it was only present in the latest version but maybe we need to backport #21976 to 8-x-y and 9-x-y

@KagamiChan
Copy link
Contributor Author

@nornagon On my computer's v8.0.0, visiting a local HTTP server with https scheme is OK (nothing shows up but this is expected)

@nornagon
Copy link
Member

#22124 has fixed a bug in 8.x that's related to this; please try 8.0.1 when it comes out later this week.

@KagamiChan
Copy link
Contributor Author

Verified 8.0.1 fixed my issue. Thanks @nornagon !

@simongregory
Copy link

v8.0.1 works for me too, Thanks!

For testing Chromiums badssl.com was helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants