mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -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\Notifications\FirstAdminNotification;
|
||||
use App\Notifications\MailTest;
|
||||
use Illuminate\Http\Client\HttpClientException;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
@ -129,11 +128,11 @@ class SettingsController extends Controller
|
|||
protected function dotEnvFileIsExposed() : bool
|
||||
{
|
||||
try {
|
||||
return Http::timeout(10)
|
||||
return Http::withoutVerifying()->timeout(10)
|
||||
->accept('*/*')
|
||||
->get(URL::to('.env'))
|
||||
->successful();
|
||||
} catch (HttpClientException $e) {
|
||||
} catch (\Exception $e) {
|
||||
Log::debug($e->getMessage());
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Tests\Feature\Settings;
|
||||
|
||||
use App\Http\Controllers\SettingsController;
|
||||
use Illuminate\Database\Events\QueryExecuted;
|
||||
use Illuminate\Http\Client\ConnectionException;
|
||||
use Illuminate\Http\Client\Request;
|
||||
|
@ -301,4 +302,11 @@ class ShowSetUpPageTest extends TestCase
|
|||
|
||||
$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