Require SSL for the RCC.

Resolves T116
This commit is contained in:
Marcel Kapfer (mmk2410) 2016-05-17 22:34:33 +02:00
parent 655b982f9d
commit 42f1992c97
2 changed files with 23 additions and 6 deletions

View file

@ -32,6 +32,17 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
require '../vendor/autoload.php';
require '../res/php/Config.php';
use \mmk2410\rbe\config\Config as Config;
$config = new Config("../config.yaml", '../vendor/autoload.php');
$settings = $config->getConfig();
include './ssl.php';
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
@ -64,12 +75,7 @@
<div class="main"> <div class="main">
<?php <?php
require '../res/php/Config.php'; $config = $settings;
use mmk2410\rbe\config\Config as Config;
$configParser = new Config('../config.yaml', '../vendor/autoload.php');
$config = $configParser->getConfig();
if ($config["rcc"]["rcc"] == "on") { if ($config["rcc"]["rcc"] == "on") {
include 'password.php'; include 'password.php';

11
rcc/ssl.php Normal file
View file

@ -0,0 +1,11 @@
<?php
// Marcel Kapfer (mmk2410) / Wilson O'Sullivan
// License: MIT License
// SSL Verification
if ($settings["rcc"]["debug"] != "on") {
if (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on") {
header('HTTP/1.1 400 Bad Request');
exit();
}
}