From 494090a3b7de23686d96530afd9509e50bff6362 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 1 Oct 2013 22:20:09 -0700 Subject: in probe diagnostic - note https failure as diagnostic info - this also changes zot_finger so you can tell it not to fallback. This could be useful in corporate environments that are off the grid or other high security situations (as much as anything could be considered high security which relies on SSL). --- mod/probe.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'mod/probe.php') diff --git a/mod/probe.php b/mod/probe.php index 397f571c5..bd792d52e 100644 --- a/mod/probe.php +++ b/mod/probe.php @@ -15,9 +15,16 @@ function probe_content(&$a) { if(x($_GET,'addr')) { $channel = $a->get_channel(); $addr = trim($_GET['addr']); - $res = zot_finger($addr,$channel); + $res = zot_finger($addr,$channel,false); $o .= '
';
-		$j = json_decode($res['body'],true);
+		if($res['success'])
+			$j = json_decode($res['body'],true);
+		else {
+			$o .= "https connection failed. Trying again with auto failover to http.\r\n\r\n";
+			$res = zot_finger($addr,$channel,true);
+			if($res['success'])
+				$j = json_decode($res['body'],true);
+		}
 		if($j && $j['permissions'] && $j['permissions']['iv'])
 			$j['permissions'] = json_decode(aes_unencapsulate($j['permissions'],$channel['channel_prvkey']),true);
 		$o .= str_replace("\n",'
',print_r($j,true)); -- cgit v1.2.3