apache stdenvvars doesn't work inside location

306 views Asked by At

I'm developing a x509 authentication with apache and symfony2. My symfony aplication has also authentication with login/password on '/login' path, and I would like to configure a location in '/login_x509'.

This is my apache configuration.

<VirtualHost *:443>
    ServerName extranet
    DocumentRoot /var/www/symfony2/extranet/web
    DirectoryIndex app.php

    Timeout 600
    KeepAliveTimeout 67

    SSLEngine on
    SSLCertificateFile /etc/apache2/ssl/extranet.crt
    SSLCertificateKeyFile /etc/apache2/ssl/extranet.key

    <Location /login_x509>
        SSLOptions +StdEnvVars
        SSLVerifyClient optional_no_ca
        SSLVerifyDepth 10
    </Location>

    <Directory /var/www/symfony2/extranet/web>
        # enable the .htaccess rewrites
        AllowOverride All
        Order allow,deny
        Allow from All
        LimitRequestBody 1024000
    </Directory>
    ErrorLog /var/log/apache2/extranet_error.log
    CustomLog /var/log/apache2/extranet_access.log combined
</VirtualHost>

If I comment the lines it Works perfectly. I get the SSL_CLIENT_S_DN variables on the application. But with the Location I don't get this variables.

I try to put the line "RequestHeader set X-Client-DN %{SSL_CLIENT_S_DN}e" inside location but it doesn't work.

Thanks in advance.

1

There are 1 answers

0
Marc Torramilans On

The solution was to use LocationMatch instead of Location.

I need to read more about apache.

Thanks!