【问题标题】:Apache cert auth is not workingApache 证书身份验证不起作用
【发布时间】:2014-09-09 18:57:39
【问题描述】:

我已经在我的公司中设置了一个虚拟主机作为 Web API,并且由于使用案例,我们配置了一个 Django 应用程序,该应用程序在 URL 路径中进行基本身份验证。需要使用证书身份验证,因此在 apache 方面,我们在另一个 URL 上配置了客户端证书验证,但似乎不起作用,apache 允许所有流量到此 URL 位置,请求标头保持不变,就好像没有请求身份验证一样服务器。

conf文件是这样的:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    WSGIPassAuthorization on
    WSGIScriptAlias / /srv/www/site/site/wsgi.py
    Alias /favicon.ico /srv/www/site/static/img/favicon.ico
    Alias /static/ /srv/www/site/static/
    Header set Access-Control-Allow-Origin http://127.0.0.1:9000

    SSLVerifyClient none
    SSLCACertificateFile ssl.crt/ClientCheck_CA.crt

    DocumentRoot /srv/www/site

    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>

    <Directory /srv/www/site>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    <Location /api-certauth/>
        SSLVerifyClient require
        SSLVerifyDepth 3
        SSLOptions +ExportCertData
    </Location>

    <Directory /srv/www/site/static>
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

</VirtualHost>

基本上,当我请求 http://server-name.com/api-certauth 时,我的浏览器没有像服务器中的任何其他 URL 一样请求身份验证

【问题讨论】:

    标签: apache authentication ssl certificate


    【解决方案1】:

    解决了我的问题,将端口 80 更改为 443

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-05-03
      • 2022-06-23
      • 2023-03-22
      • 1970-01-01
      • 2012-10-04
      • 2018-10-20
      相关资源
      最近更新 更多