Skip to content

Commit

Permalink
Show import certificate error
Browse files Browse the repository at this point in the history
  • Loading branch information
aarnaud committed May 22, 2016
1 parent 126677a commit 816365e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/electron/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ app.on('ready', function() {
});

var crtFiles = dialog.showOpenDialog({
title: "Select authentification certificate",
title: "Select authentification certificate (without password)",
properties: ['openFile'],
filters: [
{name: 'SSL Client Certificate', extensions: ['p12', 'pfx']}
Expand All @@ -86,9 +86,18 @@ app.on('ready', function() {
if(crtFiles){
app.importCertificate({
'certificate': crtFiles[0],
'password': ''
'password': '' //TODO: prompt password
}, function(result) {
console.log(result);
if(result !== 0){
dialog.showMessageBox({
type: "error",
title: "Import certificate failed",
message: "Failed to import certificate.",
detail: "Code: " + result + ".\n" +
"Check on: https://code.google.com/p/chromium/codesearch#chromium/src/net/base/net_error_list.h",
buttons: ['Ok']
});
}
});
}

Expand Down

0 comments on commit 816365e

Please sign in to comment.