Lighttpd 클라이언트 인증서 인증

Lighttpd 클라이언트 인증서 인증

내 내부 Windows CA를 사용하여 lighttpd로 클라이언트 인증서 인증을 활성화하려고 합니다. 면책조항: 저는 아직 PKI를 처음 접했습니다. :D

내 홈랩에는 오프라인 루트 CA와 하위 CA가 있습니다. 이미 신뢰할 수 있는 CA의 루트 CA를 Firefox로 가져왔습니다. 클라이언트 인증서의 경우 openssl을 사용하여 클라이언트 인증이 활성화된 템플릿을 사용하여 하위 CA로 서명한 CSR을 생성했습니다. 이 클라이언트 인증서는 pfx 파일로도 Firefox에 가져옵니다. 또한 lighttpd를 다음과 같이 구성했습니다.

ssl.pemfile = "/etc/lighttpd/certs/lighttpd.pem"
ssl.ca-file = "/etc/lighttpd/certs/ca.cer"
ssl.verifyclient.activate = "enable"
ssl.verifyclient.enforce = "enable"
ssl.verifyclient.username = "SSL_CLIENT_S_DN_CN"

다음 오류가 발생합니다.

파이어폭스 오류:

Peer does not recognize and trust the CA that issued your certificate.
Error code: SSL_ERROR_UNKNOWN_CA_ALERT

Lighttpd 오류:

SSL: 1 error:14089086:SSL routines:ssl3_get_client_certificate:certificate verify failed 
SSL: 1 -1 error:140E0197:SSL routines:SSL_shutdown:shutdown while in ini

다른:

Acceptable client certificate CA names
DC = org, DC = homelab, CN = homelab-V-2019-ICA-CA
Client Certificate Types: RSA sign, DSA sign, ECDSA sign

CA.cer

Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            5a:00:00:00:02:47:18:65:49:6e:51:2a:56:00:00:00:00:00:02
    Signature Algorithm: sha256WithRSAEncryption
        Issuer: CN=V-2019-RCA-CA
        Validity
            Not Before: Nov 24 06:00:19 2020 GMT
            Not After : Nov 24 06:10:19 2021 GMT
        Subject: DC=org, DC=homelab, CN=homelab-V-2019-ICA-CA
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                Public-Key: (2048 bit)

클라이언트 인증서

Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            56:00:00:00:23:c0:0e:f2:75:d8:de:ef:65:00:00:00:00:00:23
        Signature Algorithm: sha256WithRSAEncryption
        Issuer: DC = org, DC = homelab, CN = homelab-V-2019-ICA-CA
        Validity
            Not Before: Dec  1 23:54:33 2020 GMT
            Not After : Nov 24 06:10:19 2021 GMT
        Subject: C = US, ST = Rhode Island, L = Providence, O = HOMELAB, OU = HOMELAB, CN = homelab-V-2019-ICA-CA.homelab.org
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                RSA Public-Key: (2048 bit)
...
            X509v3 Extended Key Usage: 
                TLS Web Server Authentication, TLS Web Client Authentication
            1.3.6.1.4.1.311.21.10: 

여기서 어디로 가야할지 잘 모르겠습니다. 어떤 도움이나 기사라도 대단히 감사하겠습니다. :)

답변1

누군가가 이 문제에 직면하면 문제가 무엇인지 알아냈습니다. 지금 생각해보면 좀 뻔한 것 같아요. ADCS 웹 등록 페이지에서 다운로드한 하위 CA 인증서를 사용하고 있었습니다. 대신 인증 경로 -> 인증서 보기(루트 CA에서) -> 세부 정보 -> 파일에 복사 -> Base-64로 인코딩된 X.509를 클릭하여 하위 CA 인증서에서 내보낸 루트 CA 인증서를 사용했습니다. 나는 이것을 이 라인에 사용했습니다.

ssl.ca-file = "/etc/lighttpd/certs/ca.cer"

클라이언트 인증서를 Firefox로 가져왔는데 제대로 작동합니다.

관련 정보