Просмотр исходного кода

start work on self signed certs

CauseFX 6 лет назад
Родитель
Сommit
20c78cc3c0
2 измененных файлов с 8 добавлено и 2 удалено
  1. 3 2
      api/config/default.php
  2. 5 0
      api/functions/normal-functions.php

+ 3 - 2
api/config/default.php

@@ -230,11 +230,12 @@ return array(
 	'debugErrors' => false,
 	'healthChecksURL' => 'https://healthchecks.io/api/v1/checks/',
 	'gaTrackingID' => '',
-	'loginAttempts' => '3',
+	'loginAttempts' => '5',
 	'loginLockout' => '60000',
 	'ombiDefaultFilterAvailable' => true,
 	'ombiDefaultFilterUnavailable' => true,
 	'ombiDefaultFilterApproved' => true,
 	'ombiDefaultFilterUnapproved' => true,
-	'ombiDefaultFilterDenied' => true
+	'ombiDefaultFilterDenied' => true,
+	'selfSignedCert' => ''
 );

+ 5 - 0
api/functions/normal-functions.php

@@ -311,6 +311,11 @@ function getCert()
 {
 	$url = 'http://curl.haxx.se/ca/cacert.pem';
 	$file = __DIR__ . DIRECTORY_SEPARATOR . 'cert' . DIRECTORY_SEPARATOR . 'cacert.pem';
+	if($GLOBALS['selfSignedCert'] !== ''){
+		if(file_exists($GLOBALS['selfSignedCert'])){
+			return $GLOBALS['selfSignedCert'];
+		}
+	}
 	if (!file_exists($file)) {
 		file_put_contents($file, fopen($url, 'r'));
 	} elseif (file_exists($file) && time() - 2592000 > filemtime($file)) {