You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to integrate logs from another application of mine, as described in the documentation. The problem is that I need to disable SSL certificate verification for that server. When I set the flag 'verify_server_certificate' => false, the application that will view the logs starts resolving the host to localhost, and the request fails.
My configuration file:
/*
|--------------------------------------------------------------------------
| Log Viewer route middleware.
|--------------------------------------------------------------------------
| Optional middleware to use when loading the initial Log Viewer page.
|
*/
'middleware' => [
'web',
\Opcodes\LogViewer\Http\Middleware\AuthorizeLogViewer::class,
],
/*
|--------------------------------------------------------------------------
| Log Viewer API middleware.
|--------------------------------------------------------------------------
| Optional middleware to use on every API request. The same API is also
| used from within the Log Viewer user interface.
|
*/
'api_middleware' => [
\Opcodes\LogViewer\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
\Opcodes\LogViewer\Http\Middleware\AuthorizeLogViewer::class,
],
'api_stateful_domains' => env('LOG_VIEWER_API_STATEFUL_DOMAINS') ? explode(',', env('LOG_VIEWER_API_STATEFUL_DOMAINS')) : null,
/*
|--------------------------------------------------------------------------
| Log Viewer Remote hosts.
|--------------------------------------------------------------------------
| Log Viewer supports viewing Laravel logs from remote hosts. They must
| be running Log Viewer as well. Below you can define the hosts you
| would like to show in this Log Viewer instance.
|
*/
'hosts' => [
'local' => [
'name' => ucfirst(env('APP_ENV', 'local')),
],
'integration' => [
'name' => 'Integration',
'host' => env('LOG_VIEWER_INTEGRATION_HOST'),
'auth' => [ // Example of HTTP Basic auth
'token' => env('LOG_VIEWER_INTEGRATION_TOKEN')
],
'verify_server_certificate' => false,
],
//
// 'production' => [
// 'name' => 'Production',
// 'host' => 'https://example.com/log-viewer',
// 'auth' => [ // Example of Bearer token auth
// 'token' => env('LOG_VIEWER_PRODUCTION_TOKEN'),
// ],
// 'headers' => [
// 'X-Foo' => 'Bar',
// ],
// 'verify_server_certificate' => true,
// ],
],
Error I receive when selecting the Integration server:
cURL error 7: Failed to connect to localhost port 443 after 2256 ms: Could not connect to server (see https:\/\/curl.haxx.se\/libcurl\/c\/libcurl-errors.html) for https:\/\/localhost\/log-viewer\/api\/folders?direction=desc
It preserves the original URL protocol, but the host is overwritten to localhost. I noticed that if I disable the headers: X-Forwarded-Host, X-Forwarded-Port, X-Forwarded-Proto in the ForwardRequestToHostMiddleware, the request stops resolving the host to localhost.
Is there something I'm doing wrong, or can someone help me with this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to integrate logs from another application of mine, as described in the documentation. The problem is that I need to disable SSL certificate verification for that server. When I set the flag
'verify_server_certificate' => false, the application that will view the logs starts resolving the host to localhost, and the request fails.My configuration file:
Error I receive when selecting the Integration server:
cURL error 7: Failed to connect to localhost port 443 after 2256 ms: Could not connect to server (see https:\/\/curl.haxx.se\/libcurl\/c\/libcurl-errors.html) for https:\/\/localhost\/log-viewer\/api\/folders?direction=descIt preserves the original URL protocol, but the host is overwritten to localhost. I noticed that if I disable the headers:
X-Forwarded-Host,X-Forwarded-Port,X-Forwarded-Protoin theForwardRequestToHostMiddleware, the request stops resolving the host to localhost.Is there something I'm doing wrong, or can someone help me with this?
Beta Was this translation helpful? Give feedback.
All reactions