From 584b540116346eb2e842f8d4cc2820ae449989a8 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 17 May 2013 23:08:53 -0400 Subject: [PATCH] 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 --- SparkleLib/SparkleFetcherSSH.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SparkleLib/SparkleFetcherSSH.cs b/SparkleLib/SparkleFetcherSSH.cs index 33fdc3cd..d55a9de8 100644 --- a/SparkleLib/SparkleFetcherSSH.cs +++ b/SparkleLib/SparkleFetcherSSH.cs @@ -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) {