mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-12 16:44:08 -08:00
Merge pull request #15147 from uberbrady/fix_setup_ssl_check
Fix setup ssl check
This commit is contained in:
commit
09e2c0beab
|
@ -14,7 +14,6 @@ use App\Models\Asset;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Notifications\FirstAdminNotification;
|
use App\Notifications\FirstAdminNotification;
|
||||||
use App\Notifications\MailTest;
|
use App\Notifications\MailTest;
|
||||||
use Illuminate\Http\Client\HttpClientException;
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\App;
|
use Illuminate\Support\Facades\App;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
@ -129,11 +128,11 @@ class SettingsController extends Controller
|
||||||
protected function dotEnvFileIsExposed() : bool
|
protected function dotEnvFileIsExposed() : bool
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
return Http::timeout(10)
|
return Http::withoutVerifying()->timeout(10)
|
||||||
->accept('*/*')
|
->accept('*/*')
|
||||||
->get(URL::to('.env'))
|
->get(URL::to('.env'))
|
||||||
->successful();
|
->successful();
|
||||||
} catch (HttpClientException $e) {
|
} catch (\Exception $e) {
|
||||||
Log::debug($e->getMessage());
|
Log::debug($e->getMessage());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace Tests\Feature\Settings;
|
namespace Tests\Feature\Settings;
|
||||||
|
|
||||||
|
use App\Http\Controllers\SettingsController;
|
||||||
use Illuminate\Database\Events\QueryExecuted;
|
use Illuminate\Database\Events\QueryExecuted;
|
||||||
use Illuminate\Http\Client\ConnectionException;
|
use Illuminate\Http\Client\ConnectionException;
|
||||||
use Illuminate\Http\Client\Request;
|
use Illuminate\Http\Client\Request;
|
||||||
|
@ -301,4 +302,11 @@ class ShowSetUpPageTest extends TestCase
|
||||||
|
|
||||||
$this->assertSeeDirectoryPermissionError(false);
|
$this->assertSeeDirectoryPermissionError(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testInvalidTLSCertsOkWhenCheckingForEnvFile()
|
||||||
|
{
|
||||||
|
//set the weird bad SSL cert place - https://self-signed.badssl.com
|
||||||
|
$this->markTestIncomplete("Not yet sure how to write this test, it requires messing with .env ...");
|
||||||
|
$this->assertTrue((new SettingsController())->dotEnvFileIsExposed());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue