1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-15 21:15:23 +02:00

[233160] [dstore] SSL/non-SSL alert are not appropriate

This commit is contained in:
David McKnight 2008-08-18 12:52:53 +00:00
parent 34144af27c
commit b121ba32fc
2 changed files with 47 additions and 15 deletions

View file

@ -33,6 +33,7 @@
* David McKnight (IBM) - [228334][api][breaking][dstore] Default DataStore connection timeout is too short * David McKnight (IBM) - [228334][api][breaking][dstore] Default DataStore connection timeout is too short
* David McKnight (IBM) - [235756] [dstore] Unable to connect to host with SSL via REXEC * David McKnight (IBM) - [235756] [dstore] Unable to connect to host with SSL via REXEC
* David McKnight (IBM) - [244116] [dstore][daemon][ssl] Connecting to RSE server doesn't complete when the connection is SSL * David McKnight (IBM) - [244116] [dstore][daemon][ssl] Connecting to RSE server doesn't complete when the connection is SSL
* David McKnight (IBM) - [233160] [dstore] SSL/non-SSL alert are not appropriate
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.connectorservice.dstore; package org.eclipse.rse.connectorservice.dstore;
@ -530,6 +531,7 @@ public class DStoreConnectorService extends StandardConnectorService implements
} }
_isConnecting = true; _isConnecting = true;
boolean alertedNONSSL = false;
// set A_PLUGIN_PATH so that dstore picks up the property // set A_PLUGIN_PATH so that dstore picks up the property
setPluginPathProperty(); setPluginPathProperty();
@ -697,8 +699,33 @@ public class DStoreConnectorService extends StandardConnectorService implements
if (setSSLProperties(false)) if (setSSLProperties(false))
{ {
usedSSL = false; usedSSL = false;
boolean allowNonSSL = true;
// warning before launch without SSL
IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore();
if (store.getBoolean(ISystemPreferencesConstants.ALERT_NONSSL))
{
String cmsg = NLS.bind(ConnectorServiceResources.MSG_COMM_NOT_USING_SSL, getHostName());
msg = createSystemMessage(IConnectorServiceMessageIds.MSG_COMM_NOT_USING_SSL, IStatus.INFO, cmsg);
DisplayHidableSystemMessageAction msgAction = new DisplayHidableSystemMessageAction(msg, store, ISystemPreferencesConstants.ALERT_NONSSL);
Display.getDefault().syncExec(msgAction);
if (msgAction.getReturnCode() != IDialogConstants.YES_ID){
allowNonSSL = false;
} else {
alertedNONSSL = true;
}
}
if (allowNonSSL){
launchStatus = launchServer(clientConnection, info, daemonPort, monitor, timeout); launchStatus = launchServer(clientConnection, info, daemonPort, monitor, timeout);
} }
else {
_isConnecting = false;
clientConnection = null;
throw new OperationCanceledException();
}
}
} }
if (!launchStatus.isConnected()) if (!launchStatus.isConnected())
@ -896,6 +923,7 @@ public class DStoreConnectorService extends StandardConnectorService implements
} }
else if (!clientConnection.getDataStore().usingSSL() && store.getBoolean(ISystemPreferencesConstants.ALERT_NONSSL)) else if (!clientConnection.getDataStore().usingSSL() && store.getBoolean(ISystemPreferencesConstants.ALERT_NONSSL))
{ {
if (!alertedNONSSL){ // only alert if we haven't already
String cmsg = NLS.bind(ConnectorServiceResources.MSG_COMM_NOT_USING_SSL, getHostName()); String cmsg = NLS.bind(ConnectorServiceResources.MSG_COMM_NOT_USING_SSL, getHostName());
msg = createSystemMessage(IConnectorServiceMessageIds.MSG_COMM_NOT_USING_SSL, IStatus.INFO, cmsg); msg = createSystemMessage(IConnectorServiceMessageIds.MSG_COMM_NOT_USING_SSL, IStatus.INFO, cmsg);
@ -908,6 +936,7 @@ public class DStoreConnectorService extends StandardConnectorService implements
throw new InterruptedException(); throw new InterruptedException();
} }
} }
}
DataStore dataStore = clientConnection.getDataStore(); DataStore dataStore = clientConnection.getDataStore();

View file

@ -20,6 +20,8 @@
* David McKnight (IBM) - [231964] [ssh] SSH login dialog appears twice after cancel, when doing Refresh on a node * David McKnight (IBM) - [231964] [ssh] SSH login dialog appears twice after cancel, when doing Refresh on a node
* David McKnight (IBM) - [235164] SystemView should allow to create filter in disconnected mode * David McKnight (IBM) - [235164] SystemView should allow to create filter in disconnected mode
* David McKnight (IBM) - [239368] Expand to action ignores the filter string * David McKnight (IBM) - [239368] Expand to action ignores the filter string
* David McKnight (IBM) - [244270] Explicit check for isOffline and just returning block implementing a cache for Work Offline
* David McKnight (IBM) - [233160] [dstore] SSL/non-SSL alert are not appropriate
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.ui.operations; package org.eclipse.rse.ui.operations;
@ -245,9 +247,7 @@ public class SystemFetchOperation extends JobChangeAdapter implements IRunnableW
{ {
ss = (SubSystem)_adapter.getSubSystem(_remoteObject); ss = (SubSystem)_adapter.getSubSystem(_remoteObject);
} }
if (ss.isOffline() ){
return;
}
boolean isPromptable = false; boolean isPromptable = false;
@ -260,7 +260,8 @@ public class SystemFetchOperation extends JobChangeAdapter implements IRunnableW
synchronized (ss.getConnectorService()) synchronized (ss.getConnectorService())
{ {
if (!ss.isConnected() && !isPromptable) if (!ss.isConnected() && !isPromptable &&
!ss.isOffline()) // skip the connect if offline, but still follow through because we need to follow through in the subsystem
{ {
Display dis = Display.getDefault(); Display dis = Display.getDefault();
@ -283,10 +284,12 @@ public class SystemFetchOperation extends JobChangeAdapter implements IRunnableW
catch (InvocationTargetException exc) catch (InvocationTargetException exc)
{ {
showOperationErrorMessage(null, exc, ss); showOperationErrorMessage(null, exc, ss);
return;
} }
catch (Exception e) catch (Exception e)
{ {
showOperationErrorMessage(null, e, ss); showOperationErrorMessage(null, e, ss);
return;
} }
dis.asyncExec(new UpdateRegistry(ss)); dis.asyncExec(new UpdateRegistry(ss));