diff --git a/config/log-viewer.php b/config/log-viewer.php index 6b7e2794..a8646c5d 100644 --- a/config/log-viewer.php +++ b/config/log-viewer.php @@ -114,6 +114,7 @@ // 'username' => 'username', // 'password' => 'password', // ], + // 'verify_server_certificate' => true, // ], // // 'production' => [ @@ -125,6 +126,7 @@ // 'headers' => [ // 'X-Foo' => 'Bar', // ], + // 'verify_server_certificate' => true, // ], ], diff --git a/src/Host.php b/src/Host.php index 7e356882..31e3439a 100644 --- a/src/Host.php +++ b/src/Host.php @@ -14,6 +14,7 @@ public function __construct( public ?string $host = null, public ?array $headers = null, public ?array $auth = null, + public ?bool $verifyServerCertificate = true, ) { $this->is_remote = $this->isRemote(); } @@ -26,6 +27,7 @@ public static function fromConfig(string|int $identifier, array $config = []): s $config['host'] ?? null, $config['headers'] ?? [], $config['auth'] ?? [], + $config['verify_server_certificate'] ?? true, ); } diff --git a/src/Http/Middleware/ForwardRequestToHostMiddleware.php b/src/Http/Middleware/ForwardRequestToHostMiddleware.php index cee2ccbe..0f6aa357 100644 --- a/src/Http/Middleware/ForwardRequestToHostMiddleware.php +++ b/src/Http/Middleware/ForwardRequestToHostMiddleware.php @@ -36,6 +36,10 @@ public function handle(Request $request, Closure $next) $proxyRequest = $proxyRequest->withDigestAuth($host->auth['username'], $host->auth['password']); } + if (! $host->verifyServerCertificate) { + $proxyRequest = $proxyRequest->withoutVerifying(); + } + $response = $proxyRequest->send($request->method(), $url); return response(