/*
 * Copyright (c) Markus Duft <markus.duft@salomon.at>
 * I put this file in the public domain. Do with it what you like, but don't blame me afterwards :)
 */
package com.wamas.ide.git;

import org.eclipse.jgit.transport.JschConfigSessionFactory;
import org.eclipse.jgit.transport.OpenSshConfig.Host;
import org.eclipse.jgit.util.FS;

import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;

public class AnyHostSshSessionFactory extends JschConfigSessionFactory {

    @Override
    protected JSch createDefaultJSch(FS fs) throws JSchException {
        JSch def = super.createDefaultJSch(fs);
        def.setHostKeyRepository(new AnyHostKeyRepository());
        return def;
    }

    @Override
    protected void configure(Host arg0, Session arg1) {
        // nothing to do
    }

}
