How to Fix Invalid Request (Unsupported Ssl Request)

How to fix Invalid request (Unsupported SSL request)

I solved this later, just in case anyone has a similar problem in the future, I discovered the AppServiceProvider class had a register method where a security interception middleware was registered to force every HTTP request to HTTPS. So I wrote an if-else logic to allow this only on production since my localhost had no SSL certificate.

in app/providers/AppServiceProvider.php

look for the register() method, then implement the logic by checking whether the app is local or not. The isLocal() method checks your .env file for APP_ENV variable and returns true if it is local, so you reconfirm again that, that is set to local and be sure to clear any previous configuration cache.

//check that app is local
if ($this->app->isLocal()) {
//if local register your services you require for development
$this->app->register('Barryvdh\Debugbar\ServiceProvider');
} else {
//else register your services you require for production
$this->app['request']->server->set('HTTPS', true);
}

how to fix Invalid request (Unsupported SSL request) only php?

// Se debe validar el token recibido con el servidor,
// de autenticación ejecutando una llamada a tráves
// de curl.
$url = 'https://localhost:8001';

needs to be

// Se debe validar el token recibido con el servidor,
// de autenticación ejecutando una llamada a tráves
// de curl.
$url = 'http://localhost:8001';


Related Topics



Leave a reply



Submit