mirror of
				https://github.com/zulip/zulip-desktop.git
				synced 2025-11-04 05:53:21 +00:00 
			
		
		
		
	Detailed certificate warning message #126
This commit is contained in:
		@@ -1,6 +1,6 @@
 | 
				
			|||||||
'use strict';
 | 
					'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const {app, dialog} = require('electron').remote;
 | 
					const { app, dialog } = require('electron').remote;
 | 
				
			||||||
const fs = require('fs');
 | 
					const fs = require('fs');
 | 
				
			||||||
const path = require('path');
 | 
					const path = require('path');
 | 
				
			||||||
const JsonDB = require('node-json-db');
 | 
					const JsonDB = require('node-json-db');
 | 
				
			||||||
@@ -128,11 +128,17 @@ class DomainUtil {
 | 
				
			|||||||
							resolve(serverConf);
 | 
												resolve(serverConf);
 | 
				
			||||||
						});
 | 
											});
 | 
				
			||||||
					} else {
 | 
										} else {
 | 
				
			||||||
 | 
											const certErrorMessage = `Do you trust certificate from ${domain}? \n ${error}`;
 | 
				
			||||||
 | 
											const certErrorDetail = `The server you're connecting to is either someone impersonating the Zulip server you entered, or the server you're trying to connect to is configured in an insecure way.
 | 
				
			||||||
 | 
											\n Unless you have a good reason to believe otherwise, you should not proceed.
 | 
				
			||||||
 | 
											\n You can click here if you'd like to proceed with the connection.`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						dialog.showMessageBox({
 | 
											dialog.showMessageBox({
 | 
				
			||||||
							type: 'question',
 | 
												type: 'warning',
 | 
				
			||||||
							buttons: ['Yes', 'No'],
 | 
												buttons: ['Yes', 'No'],
 | 
				
			||||||
							defaultId: 0,
 | 
												defaultId: 0,
 | 
				
			||||||
							message: `Do you trust certificate from ${domain}? \n ${error}`
 | 
												message: certErrorMessage,
 | 
				
			||||||
 | 
												detail: certErrorDetail
 | 
				
			||||||
						}, response => {
 | 
											}, response => {
 | 
				
			||||||
							if (response === 0) {
 | 
												if (response === 0) {
 | 
				
			||||||
								this.getServerSettings(domain).then(serverSettings => {
 | 
													this.getServerSettings(domain).then(serverSettings => {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user