Преглед изворни кода

Show HTTPS error for self signed certificate

Markus-Rost пре 4 година
родитељ
комит
3254187c07
6 измењених фајлова са 8 додато и 8 уклоњено
  1. 1 1
      RcGcDb
  2. 2 2
      cmds/rcscript.js
  3. 1 1
      cmds/settings.js
  4. 1 1
      dashboard/oauth.js
  5. 2 2
      dashboard/rcscript.js
  6. 1 1
      dashboard/settings.js

+ 1 - 1
RcGcDb

@@ -1 +1 @@
-Subproject commit b952e6273076b4e4e7883a3e07b1bf83f386e450
+Subproject commit 275907d31d35d7965a35ab7483c02e2a2dbc8e81

+ 2 - 2
cmds/rcscript.js

@@ -155,7 +155,7 @@ function cmd_rcscript(lang, msg, args, line, wiki) {
 				} );
 			}, error => {
 				if ( reaction ) reaction.removeEmoji();
-				if ( error.message?.startsWith( 'connect ECONNREFUSED ' ) || error.message?.startsWith( 'Hostname/IP does not match certificate\'s altnames: ' ) || error.message === 'certificate has expired' ) {
+				if ( error.message?.startsWith( 'connect ECONNREFUSED ' ) || error.message?.startsWith( 'Hostname/IP does not match certificate\'s altnames: ' ) || error.message === 'certificate has expired' || error.message === 'self signed certificate' ) {
 					console.log( '- Error while testing the wiki: No HTTPS' );
 					return msg.replyMsg( lang.get('settings.wikiinvalid_http') + wikihelp, {}, true );
 				}
@@ -308,7 +308,7 @@ function cmd_rcscript(lang, msg, args, line, wiki) {
 					} );
 				}, error => {
 					if ( reaction ) reaction.removeEmoji();
-					if ( error.message?.startsWith( 'connect ECONNREFUSED ' ) || error.message?.startsWith( 'Hostname/IP does not match certificate\'s altnames: ' ) || error.message === 'certificate has expired' ) {
+					if ( error.message?.startsWith( 'connect ECONNREFUSED ' ) || error.message?.startsWith( 'Hostname/IP does not match certificate\'s altnames: ' ) || error.message === 'certificate has expired' || error.message === 'self signed certificate' ) {
 						console.log( '- Error while testing the wiki: No HTTPS' );
 						return msg.replyMsg( lang.get('settings.wikiinvalid_http') + wikihelp, {}, true );
 					}

+ 1 - 1
cmds/settings.js

@@ -183,7 +183,7 @@ function cmd_settings(lang, msg, args, line, wiki) {
 					} );
 				}, ferror => {
 					if ( reaction ) reaction.removeEmoji();
-					if ( ferror.message?.startsWith( 'connect ECONNREFUSED ' ) || ferror.message?.startsWith( 'Hostname/IP does not match certificate\'s altnames: ' ) || ferror.message === 'certificate has expired' ) {
+					if ( ferror.message?.startsWith( 'connect ECONNREFUSED ' ) || ferror.message?.startsWith( 'Hostname/IP does not match certificate\'s altnames: ' ) || ferror.message === 'certificate has expired' || ferror.message === 'self signed certificate' ) {
 						console.log( '- Error while testing the wiki: No HTTPS' );
 						return msg.replyMsg( lang.get('settings.wikiinvalid_http') + wikihelp, {}, true );
 					}

+ 1 - 1
dashboard/oauth.js

@@ -279,7 +279,7 @@ function dashboard_api(res, input) {
 		result.customRcGcDw = wiki.toLink('MediaWiki:Custom-RcGcDw', 'action=edit');
 		if ( wiki.isFandom() ) return;
 	}, error => {
-		if ( error.message?.startsWith( 'connect ECONNREFUSED ' ) || error.message?.startsWith( 'Hostname/IP does not match certificate\'s altnames: ' ) || error.message === 'certificate has expired' ) {
+		if ( error.message?.startsWith( 'connect ECONNREFUSED ' ) || error.message?.startsWith( 'Hostname/IP does not match certificate\'s altnames: ' ) || error.message === 'certificate has expired' || error.message === 'self signed certificate' ) {
 			console.log( '- Dashboard: Error while testing the wiki: No HTTPS' );
 			result.error_code = 'http';
 			result.error = true;

+ 2 - 2
dashboard/rcscript.js

@@ -430,7 +430,7 @@ function update_rcscript(res, userSettings, guild, type, settings) {
 					return res(`/guild/${guild}/rcscript/new`, 'savefail');
 				} );
 			}, error => {
-				if ( error.message?.startsWith( 'connect ECONNREFUSED ' ) || error.message?.startsWith( 'Hostname/IP does not match certificate\'s altnames: ' ) || error.message === 'certificate has expired' ) {
+				if ( error.message?.startsWith( 'connect ECONNREFUSED ' ) || error.message?.startsWith( 'Hostname/IP does not match certificate\'s altnames: ' ) || error.message === 'certificate has expired' || error.message === 'self signed certificate' ) {
 					console.log( '- Dashboard: Error while testing the wiki: No HTTPS' );
 					return res(`/guild/${guild}/rcscript/new`, 'savefail', 'http');
 				}
@@ -746,7 +746,7 @@ function update_rcscript(res, userSettings, guild, type, settings) {
 						return res(`/guild/${guild}/rcscript/${type}`, 'savefail');
 					} );
 				}, error => {
-					if ( error.message?.startsWith( 'connect ECONNREFUSED ' ) || error.message?.startsWith( 'Hostname/IP does not match certificate\'s altnames: ' ) || error.message === 'certificate has expired' ) {
+					if ( error.message?.startsWith( 'connect ECONNREFUSED ' ) || error.message?.startsWith( 'Hostname/IP does not match certificate\'s altnames: ' ) || error.message === 'certificate has expired' || error.message === 'self signed certificate' ) {
 						console.log( '- Dashboard: Error while testing the wiki: No HTTPS' );
 						return res(`/guild/${guild}/rcscript/${type}`, 'savefail', 'http');
 					}

+ 1 - 1
dashboard/settings.js

@@ -410,7 +410,7 @@ function update_settings(res, userSettings, guild, type, settings) {
 				return Promise.reject();
 			} );
 		}, error => {
-			if ( error.message?.startsWith( 'connect ECONNREFUSED ' ) || error.message?.startsWith( 'Hostname/IP does not match certificate\'s altnames: ' ) || error.message === 'certificate has expired' ) {
+			if ( error.message?.startsWith( 'connect ECONNREFUSED ' ) || error.message?.startsWith( 'Hostname/IP does not match certificate\'s altnames: ' ) || error.message === 'certificate has expired' || error.message === 'self signed certificate' ) {
 				console.log( '- Dashboard: Error while testing the wiki: No HTTPS' );
 				return Promise.reject('http');
 			}