when using tor .onion addresses, skip ssh-keyscan (no proxying support)

Tor has special domain names called ".onion addresses".  They can only be
resolved by using a proxy via tor. While the rest of the openssh suite
fully supports proxying. ssh-keyscan does not, so it can't be used for
.onion addresses because it just barfs saying unknown host
This commit is contained in:
Hans-Christoph Steiner 2013-05-17 23:08:53 -04:00
parent b26d1b1d55
commit 584b540116

View file

@ -16,7 +16,12 @@ namespace SparkleLib {
public override bool Fetch ()
{
if (!RemoteUrl.Scheme.StartsWith ("http")) {
if (RemoteUrl.Host.EndsWith(".onion")) {
// Tor has special domain names called ".onion addresses". They can only be
// resolved by using a proxy via tor. While the rest of the openssh suite
// fully supports proxying, ssh-keyscan does not, so we can't use it for .onion
SparkleLogger.LogInfo ("Auth", "using tor .onion address skipping ssh-keyscan");
} else if (!RemoteUrl.Scheme.StartsWith ("http")) {
string host_key = FetchHostKey ();
if (string.IsNullOrEmpty (RemoteUrl.Host) || host_key == null) {