내 Nginx는 내 앱이 보내는 인증서를 신뢰하지 않습니까?

내 Nginx는 내 앱이 보내는 인증서를 신뢰하지 않습니까?

SSL이 있고 클라이언트 확인도 수행하는 NGINX 서버를 설정하려고 합니다. 어떤 이유로 작동하지 않습니다. 2개의 스프링 부트 애플리케이션 간에 인증서를 시험해 보면 작동합니다. 그래서 자격증이 좋습니다. 다음 nginx 구성 파일이 있습니다.

#user  nobody;
worker_processes auto;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;


    sendfile        on;

    keepalive_timeout  65;

    server {
        listen 443 ssl;
        
        ssl_certificate D:/nginx/server.cer;
        ssl_certificate_key D:/nginx/server.pkcs8;

        ssl_verify_client on;
        ssl_trusted_certificate D:/nginx/client.cer;
        ssl_client_certificate D:/nginx/client.cer;

        
        server_name localhost;
        
        location / {            
            return 301 https://www.google.com/ ;
        }
        
        location /api/user {
            proxy_pass http://localhost:8443/api/user ;
        }
        
        location /api/key {
            proxy_pass http://localhost:8443/api/key ;
        }
        

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

ssl_verify_client on;이것을 다음 과 같이 변경하면 ssl_verify_client off;예상한 결과를 얻습니다. 그럼 나머지 구성은 괜찮을 겁니다... 오늘 NGINX를 시작했는데, 도움을 좀 받고 싶습니다.

인증서는 내가 만듭니다. 발급자도 없고 인증서 체인도 없습니다. 자체 서명된 인증서.

미리 감사드립니다.

답변1

지시문 ssl_client_certificate(및 ssl_trusted_certificate이를 사용하기로 결정한 경우)에는 클라이언트 인증서가 확인되는 CA 인증서가 포함되어야 합니다. 클라이언트 인증서에 서명하는 데 사용한 CA 인증서가 포함된 파일을 가리키도록 이러한 지시문을 변경합니다.

관련 정보