diff options
-rw-r--r-- | lib/Config.php | 7 | ||||
-rw-r--r-- | lib/Controller/BackendController.php | 9 | ||||
-rw-r--r-- | lib/Settings/Admin/SignalingServer.php | 1 | ||||
-rw-r--r-- | templates/settings/admin/signaling-server.php | 5 |
4 files changed, 19 insertions, 3 deletions
diff --git a/lib/Config.php b/lib/Config.php index 5b9019854..7e440843c 100644 --- a/lib/Config.php +++ b/lib/Config.php @@ -120,6 +120,13 @@ class Config { } /** + * @return bool + */ + public function allowInsecureSignaling() { + return ($this->config->getAppValue('spreed', 'signaling_skip_verify_cert', '') != ''); + } + + /** * @param string $userId * @return string */ diff --git a/lib/Controller/BackendController.php b/lib/Controller/BackendController.php index f27b4fcd4..15eb9ea81 100644 --- a/lib/Controller/BackendController.php +++ b/lib/Controller/BackendController.php @@ -93,11 +93,14 @@ class BackendController extends Controller { $headers['Spreed-Signaling-Random'] = $random; $headers['Spreed-Signaling-Checksum'] = $hash; - $response = $client->post($url, [ + $params = [ 'headers' => $headers, 'body' => $body, - 'verify' => false, - ]); + ]; + if ($this->config->allowInsecureSignaling()) { + $params['verify'] = false; + } + $response = $client->post($url, $params); } /** diff --git a/lib/Settings/Admin/SignalingServer.php b/lib/Settings/Admin/SignalingServer.php index d700d48ac..739f9e55d 100644 --- a/lib/Settings/Admin/SignalingServer.php +++ b/lib/Settings/Admin/SignalingServer.php @@ -42,6 +42,7 @@ class SignalingServer implements ISettings { $parameters = [ 'signalingServer' => $this->config->getAppValue('spreed', 'signaling_server'), 'signalingSecret' => $this->config->getAppValue('spreed', 'signaling_secret'), + 'signalingSkipVerifyCert' => $this->config->getAppValue('spreed', 'signaling_skip_verify_cert'), ]; return new TemplateResponse('spreed', 'settings/admin/signaling-server', $parameters, ''); diff --git a/templates/settings/admin/signaling-server.php b/templates/settings/admin/signaling-server.php index e960fdb41..b07e2a566 100644 --- a/templates/settings/admin/signaling-server.php +++ b/templates/settings/admin/signaling-server.php @@ -16,6 +16,11 @@ style('spreed', ['settings-admin']); value="<?php p($_['signalingServer']) ?>" /> </p> <p> + <input type="checkbox" id="signaling_skip_verify_cert" name="signaling_skip_verify_cert" class="checkbox" value="1" <?php p($_['signalingSkipVerifyCert'] ? 'checked="checked"' : '') ?>> + <label for="signaling_skip_verify_cert"><?php p($l->t('Allow invalid certificates when connecting to the external signaling server? Only enable this if required for development!')) ?> + </label> + </p> + <p> <label for="signaling_secret"><?php p($l->t('Shared secret')) ?></label> <input type="text" id="signaling_secret" name="signaling_secret" placeholder="shared secret" |