Closed
Description
Hey,
I stumble accross an error "error loading known_hosts: ; class=Ssh (23)" when I try to connect to a remote host on our company azure repo.
The git cmd tool works fine of course. So the general SSH configuration should be fine. Seems like the the configuration isn't read out correctly. Do I have to set a config of the repo or something before I connect to the remote?
I wrote a simple test tool for what Im doing:
fn main() {
let local_repo_path = r"D:\projects\some_repo_dir";
env::set_var("GIT_SSH_COMMAND", r"ssh -i *ID_RSA_PATH* -o UserKnownHostsFile=*KNOWN_HOSTS_PATH*"); // Added testwise, but it does nothing
let repo = Repository::open(local_repo_path);
match repo {
Ok(repo_unwrap) => {
let mut remote = repo_unwrap.find_remote("origin").unwrap();
let res = remote.connect(git2::Direction::Fetch); // also tested connect_auth
if res.is_err() {
println!("Could not connect {}", res.err().unwrap());
}
},
Err(_) => println!("Could not open Repo."),
}
}
Metadata
Metadata
Assignees
Labels
No labels