Search in sources :

Example 1 with GitXmlRpcSshService

use of org.jetbrains.git4idea.ssh.GitXmlRpcSshService in project intellij-community by JetBrains.

the class GitHandler method setupSshAuthenticator.

private void setupSshAuthenticator() throws IOException {
    GitXmlRpcSshService ssh = ServiceManager.getService(GitXmlRpcSshService.class);
    myEnv.put(GitSSHHandler.GIT_SSH_ENV, ssh.getScriptPath().getPath());
    mySshHandler = ssh.registerHandler(new GitSSHGUIHandler(myProject), myProject);
    myEnvironmentCleanedUp = false;
    myEnv.put(GitSSHHandler.SSH_HANDLER_ENV, mySshHandler.toString());
    int port = ssh.getXmlRcpPort();
    myEnv.put(GitSSHHandler.SSH_PORT_ENV, Integer.toString(port));
    LOG.debug(String.format("handler=%s, port=%s", mySshHandler, port));
    final HttpConfigurable httpConfigurable = HttpConfigurable.getInstance();
    boolean useHttpProxy = httpConfigurable.USE_HTTP_PROXY && !isSshUrlExcluded(httpConfigurable, ObjectUtils.assertNotNull(myUrls));
    myEnv.put(GitSSHHandler.SSH_USE_PROXY_ENV, String.valueOf(useHttpProxy));
    if (useHttpProxy) {
        myEnv.put(GitSSHHandler.SSH_PROXY_HOST_ENV, StringUtil.notNullize(httpConfigurable.PROXY_HOST));
        myEnv.put(GitSSHHandler.SSH_PROXY_PORT_ENV, String.valueOf(httpConfigurable.PROXY_PORT));
        boolean proxyAuthentication = httpConfigurable.PROXY_AUTHENTICATION;
        myEnv.put(GitSSHHandler.SSH_PROXY_AUTHENTICATION_ENV, String.valueOf(proxyAuthentication));
        if (proxyAuthentication) {
            myEnv.put(GitSSHHandler.SSH_PROXY_USER_ENV, StringUtil.notNullize(httpConfigurable.getProxyLogin()));
            myEnv.put(GitSSHHandler.SSH_PROXY_PASSWORD_ENV, StringUtil.notNullize(httpConfigurable.getPlainProxyPassword()));
        }
    }
}
Also used : HttpConfigurable(com.intellij.util.net.HttpConfigurable) GitXmlRpcSshService(org.jetbrains.git4idea.ssh.GitXmlRpcSshService)

Aggregations

HttpConfigurable (com.intellij.util.net.HttpConfigurable)1 GitXmlRpcSshService (org.jetbrains.git4idea.ssh.GitXmlRpcSshService)1