mirror of
				https://github.com/zulip/zulip-desktop.git
				synced 2025-11-04 05:53:21 +00:00 
			
		
		
		
	network: Fix request ecdhCurve mismatch errors.
				
					
				
			The HTTP Node now uses auto for ecdhCurve for SSL connections. This fixes the SSL handshake error while connecting to some Zulip instances. Setting the ecdhCurve to auto is the recommended method for Node > 8.5, more info here - https://github.com/nodejs/node/issues/16196 Fixes: #594.
This commit is contained in:
		
				
					committed by
					
						
						Akash Nimare
					
				
			
			
				
	
			
			
			
						parent
						
							925fec71d5
						
					
				
				
					commit
					6899a6bc20
				
			@@ -21,7 +21,8 @@ function linuxUpdateNotification() {
 | 
			
		||||
	const options = {
 | 
			
		||||
		url,
 | 
			
		||||
		headers: {'User-Agent': 'request'},
 | 
			
		||||
		proxy: proxyEnabled ? ProxyUtil.getProxy(url) : ''
 | 
			
		||||
		proxy: proxyEnabled ? ProxyUtil.getProxy(url) : '',
 | 
			
		||||
		ecdhCurve: 'auto'
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
	request(options, (error, response, body) => {
 | 
			
		||||
 
 | 
			
		||||
@@ -129,7 +129,8 @@ class DomainUtil {
 | 
			
		||||
		const checkDomain = {
 | 
			
		||||
			url: domain + '/static/audio/zulip.ogg',
 | 
			
		||||
			ca: (certificateLocation) ? certificateLocation : '',
 | 
			
		||||
			proxy: proxyEnabled ? ProxyUtil.getProxy(domain) : ''
 | 
			
		||||
			proxy: proxyEnabled ? ProxyUtil.getProxy(domain) : '',
 | 
			
		||||
			ecdhCurve: 'auto'
 | 
			
		||||
		};
 | 
			
		||||
 | 
			
		||||
		const serverConf = {
 | 
			
		||||
@@ -206,7 +207,8 @@ class DomainUtil {
 | 
			
		||||
		const proxyEnabled = ConfigUtil.getConfigItem('useManualProxy') || ConfigUtil.getConfigItem('useSystemProxy');
 | 
			
		||||
		const serverSettingsOptions = {
 | 
			
		||||
			url: domain + '/api/v1/server_settings',
 | 
			
		||||
			proxy: proxyEnabled ? ProxyUtil.getProxy(domain) : ''
 | 
			
		||||
			proxy: proxyEnabled ? ProxyUtil.getProxy(domain) : '',
 | 
			
		||||
			ecdhCurve: 'auto'
 | 
			
		||||
		};
 | 
			
		||||
		return new Promise((resolve, reject) => {
 | 
			
		||||
			request(serverSettingsOptions, (error, response) => {
 | 
			
		||||
@@ -232,7 +234,8 @@ class DomainUtil {
 | 
			
		||||
		const proxyEnabled = ConfigUtil.getConfigItem('useManualProxy') || ConfigUtil.getConfigItem('useSystemProxy');
 | 
			
		||||
		const serverIconOptions = {
 | 
			
		||||
			url,
 | 
			
		||||
			proxy: proxyEnabled ? ProxyUtil.getProxy(url) : ''
 | 
			
		||||
			proxy: proxyEnabled ? ProxyUtil.getProxy(url) : '',
 | 
			
		||||
			ecdhCurve: 'auto'
 | 
			
		||||
		};
 | 
			
		||||
		// The save will always succeed. If url is invalid, downgrade to default icon.
 | 
			
		||||
		return new Promise(resolve => {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user