aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-02-13 20:09:30 -0800
committerfriendica <info@friendica.com>2013-02-13 20:09:30 -0800
commitb4057cfeb494dac9ad650e7deadec695c20dc912 (patch)
treef8b898e2e38c8d1e9a14226cbab69de2daa73359 /include/zot.php
parent8b278db05c7690370945edec29a0139541538dae (diff)
downloadvolse-hubzilla-b4057cfeb494dac9ad650e7deadec695c20dc912.tar.gz
volse-hubzilla-b4057cfeb494dac9ad650e7deadec695c20dc912.tar.bz2
volse-hubzilla-b4057cfeb494dac9ad650e7deadec695c20dc912.zip
use our own CA bundle as authoritative for backend communications. This avoids OS dependent CA validity mismatches.
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php23
1 files changed, 19 insertions, 4 deletions
diff --git a/include/zot.php b/include/zot.php
index 51b04e1ef..345c5b397 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -150,7 +150,9 @@ function zot_finger($webbie,$channel) {
}
$rhs = '/.well-known/zot-info';
+ $https = ((strpos($url,'https://') === 0) ? true : false);
+ logger('zot_finger: ' . $url, LOGGER_DEBUG);
if($channel) {
$postvars = array(
@@ -161,17 +163,30 @@ function zot_finger($webbie,$channel) {
);
$result = z_post_url($url . $rhs,$postvars);
- if(! $result['success'])
- $result = z_post_url('http://' . $host . $rhs,$postvars);
+
+
+ if(! $result['success']) {
+ if($https) {
+ logger('zot_finger: https failed. falling back to http');
+ $result = z_post_url('http://' . $host . $rhs,$postvars);
+ }
+ }
}
else {
$rhs .= '?f=&address=' . urlencode($address);
$result = z_fetch_url($url . $rhs);
- if(! $result['success'])
- $result = z_fetch_url('http://' . $host . $rhs);
+ if(! $result['success']) {
+ if($https) {
+ logger('zot_finger: https failed. falling back to http');
+ $result = z_fetch_url('http://' . $host . $rhs);
+ }
+ }
}
+ if(! $result['success'])
+ logger('zot_finger: no results');
+
return $result;
}