It works only if ($app['params']['secure']['enable'] == "true")
But by default in config parameters.yml.dist:
secure:
    enable: false