title: Https requests "invalid request (unsupported ssl request)"
body: <p>I'm having problems with Https requests in Laravel 5.1</p>
  
  <p>I created a Middleware like this:</p>
  
  <pre><code>    &lt;?php
  
  namespace Subway\Http\Middleware;
  
  use Closure;
  use App;
  use Redirect;
  
  class UseSSL
  {
      public function handle($request, Closure $next)
      {
            if (!$request-&gt;secure() &amp;&amp; env('APP_ENV') === 'local')
            {
                return redirect()-&gt;secure($request-&gt;getRequestUri());
            }
            return $next($request);
      }
  }
  </code></pre>
  
  <p>and my routes are like this:</p>
  
  <pre><code>Route::group(['middleware' =&gt; 'use.ssl'], function () {
  // All other routes here
  });
  </code></pre>
  
  <p>I registered the middleware in kernel.php</p>
  
  <pre><code>protected $routeMiddleware = [
        'use.ssl' =&gt; \Subway\Http\Middleware\UseSSL::class,
      ];
  </code></pre>
  
  <p>When trying to get to any url, the page doesn't load and the terminal is returning this error:</p>
  
  <pre><code>[Thu Nov 12 11:09:30 2015] ::1:50728 Invalid request (Unsupported SSL request)
  </code></pre>
  
  <p>What's the problem with this?</p>