mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-03 21:43:18 +00:00
handle certs error properly [WIP] #211
This commit is contained in:
@@ -77,9 +77,13 @@ class DomainUtil {
|
|||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
request(checkDomain, (error, response) => {
|
request(checkDomain, (error, response) => {
|
||||||
|
const certsError =
|
||||||
|
['Error: self signed certificate',
|
||||||
|
'Error: unable to verify the first certificate'
|
||||||
|
];
|
||||||
if (!error && response.statusCode !== 404) {
|
if (!error && response.statusCode !== 404) {
|
||||||
resolve(domain);
|
resolve(domain);
|
||||||
} else if (error.toString().indexOf('Error: self signed certificate') >= 0 || 'Error: unable to verify the first certificate') {
|
} else if (certsError.indexOf(error.toString()) >= 0) {
|
||||||
if (window.confirm(`Do you trust certificate from ${domain}? \n ${error}`)) {
|
if (window.confirm(`Do you trust certificate from ${domain}? \n ${error}`)) {
|
||||||
resolve(domain);
|
resolve(domain);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user