diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index ca4563ba2d..d186d42cf4 100755 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -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; } diff --git a/tests/Feature/Settings/ShowSetUpPageTest.php b/tests/Feature/Settings/ShowSetUpPageTest.php index 7f40768db7..929c41c4ef 100644 --- a/tests/Feature/Settings/ShowSetUpPageTest.php +++ b/tests/Feature/Settings/ShowSetUpPageTest.php @@ -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()); + } }