1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 07:05:24 +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) - [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) - [233160] [dstore] SSL/non-SSL alert are not appropriate
*******************************************************************************/
package org.eclipse.rse.connectorservice.dstore;
@ -530,6 +531,7 @@ public class DStoreConnectorService extends StandardConnectorService implements
}
_isConnecting = true;
boolean alertedNONSSL = false;
// set A_PLUGIN_PATH so that dstore picks up the property
setPluginPathProperty();
@ -697,7 +699,32 @@ public class DStoreConnectorService extends StandardConnectorService implements
if (setSSLProperties(false))
{
usedSSL = false;
launchStatus = launchServer(clientConnection, info, daemonPort, monitor, timeout);
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);
}
else {
_isConnecting = false;
clientConnection = null;
throw new OperationCanceledException();
}
}
}
@ -896,16 +923,18 @@ public class DStoreConnectorService extends StandardConnectorService implements
}
else if (!clientConnection.getDataStore().usingSSL() && 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)
{
internalDisconnect(monitor);
_isConnecting = false;
throw new InterruptedException();
if (!alertedNONSSL){ // only alert if we haven't already
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)
{
internalDisconnect(monitor);
_isConnecting = false;
throw new InterruptedException();
}
}
}

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) - [235164] SystemView should allow to create filter in disconnected mode
* 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;
@ -245,9 +247,7 @@ public class SystemFetchOperation extends JobChangeAdapter implements IRunnableW
{
ss = (SubSystem)_adapter.getSubSystem(_remoteObject);
}
if (ss.isOffline() ){
return;
}
boolean isPromptable = false;
@ -260,7 +260,8 @@ public class SystemFetchOperation extends JobChangeAdapter implements IRunnableW
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();
@ -283,10 +284,12 @@ public class SystemFetchOperation extends JobChangeAdapter implements IRunnableW
catch (InvocationTargetException exc)
{
showOperationErrorMessage(null, exc, ss);
return;
}
catch (Exception e)
{
showOperationErrorMessage(null, e, ss);
return;
}
dis.asyncExec(new UpdateRegistry(ss));