I am using JGit to clone a remote git repo as:
Git.cloneRepository().setURI("ssh://krisv@10.1.5.32:8001/myrepo").setDirectory(gitDir).setCredentialsProvider(credentialsProvider).call();
However, when I do so, it gives me the following error:
org.eclipse.jgit.errors.UnsupportedCredentialItem: ssh://user@10.1.9.1:8001: org.eclipse.jgit.transport.CredentialItem$YesNoType:The authenticity of host '10.1.9.1' can't be established. DSA key fingerprint is "some value". Are you sure you want to continue connecting?
Now I don't want this message to prompt and I want to bypass this by providing Yes by default. However, I am not getting any such option in JGit.
There is an option in ssh: StrictHostKeyChecking with which we can bypass this. Is there any way by which we can use this option in JGit? Or any other way to achieve the same?
Please help. Thanks.