Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setup ssl check #15147

Merged
merged 3 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions app/Http/Controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
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;
Expand Down Expand Up @@ -129,11 +128,11 @@ public function getSetupIndex() : View
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;
}
Expand Down
8 changes: 8 additions & 0 deletions tests/Feature/Settings/ShowSetUpPageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -301,4 +302,11 @@ public function testWillNotSeeDirectoryPermissionErrorWhenStoragePathIsWritable(

$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