mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-08 17:45:24 +02:00
support case where daemon and server use differnet keystores
This commit is contained in:
parent
3cf7398481
commit
0590f6e4b0
1 changed files with 25 additions and 2 deletions
|
@ -22,6 +22,7 @@ import java.security.cert.X509Certificate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
|
import javax.net.ssl.SSLException;
|
||||||
import javax.net.ssl.SSLHandshakeException;
|
import javax.net.ssl.SSLHandshakeException;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.FileLocator;
|
import org.eclipse.core.runtime.FileLocator;
|
||||||
|
@ -638,12 +639,34 @@ public class DStoreConnectorService extends AbstractConnectorService implements
|
||||||
}
|
}
|
||||||
// connect to launched server
|
// connect to launched server
|
||||||
connectStatus = clientConnection.connect(launchStatus.getTicket(), timeout);
|
connectStatus = clientConnection.connect(launchStatus.getTicket(), timeout);
|
||||||
|
Throwable conE = connectStatus.getException();
|
||||||
if (!connectStatus.isConnected() &&
|
if (!connectStatus.isConnected() &&
|
||||||
(connectStatus.getMessage().startsWith(ClientConnection.CANNOT_CONNECT) ||
|
(connectStatus.getMessage().startsWith(ClientConnection.CANNOT_CONNECT) ||
|
||||||
connectStatus.getException() instanceof SSLHandshakeException)
|
conE instanceof SSLException
|
||||||
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
if (conE instanceof SSLHandshakeException)
|
||||||
|
{
|
||||||
|
List certs = connectStatus.getUntrustedCertificates();
|
||||||
|
if (certs != null && certs.size() > 0)
|
||||||
|
{
|
||||||
|
ISystemKeystoreProvider provider = SystemKeystoreProviderManager.getInstance().getDefaultProvider();
|
||||||
|
if (provider != null)
|
||||||
|
{
|
||||||
|
if (provider.importCertificates(certs, getHostName()))
|
||||||
|
{
|
||||||
|
connect(monitor);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new InterruptedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
launchStatus = launchServer(clientConnection, info, daemonPort, monitor);
|
launchStatus = launchServer(clientConnection, info, daemonPort, monitor);
|
||||||
if (!launchStatus.isConnected())
|
if (!launchStatus.isConnected())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue