
저는 시스템 관리자나 네트워크 관리자가 아닙니다(소프트웨어 개발자 경력이 있습니다). 구현하기 위해 이 튜토리얼을 따르는 데 몇 가지 어려움이 있습니다.SLL 클라이언트 인증Ubuntu 20.04 버전:https://www.makethenmakeinstall.com/2014/05/ssl-client-authentication-step-by-step/
나는 이 튜토리얼이 꽤 오래되었다는 것을 알고 있지만 단일 지점을 제외하고는 잘 작동하는 것 같습니다.
기본적으로 이전 튜토리얼에 표시된 모든 단계를 수행했습니다. 내가 한 일을 잘 이해하고 있다면 피드백을 주실 수도 있도록 여기에 요약합니다.
CA(인증 기관) 인증서를 생성합니다.먼저 CA 인증서를 만듭니다. 내가 잘 이해하고 있다면 그것은 내 자신의 개인 인증 기관(예: cacert.org)을 만드는 것과 같으며, 이 경우 유일한 것은 이 CA에서 발급한 인증서를 검증하는 기관이 없다는 것입니다. 이 이해가 맞나요?
openssl req -newkey rsa:4096 -keyform PEM -keyout ca.key -x509 -days 3650 -outform PEM -out ca.cer
기본적으로 이 명령은 나에게PEM 암호 문구내 CA 및 일부 세부 정보와 상호 작용하는 데 사용할 것입니다. 다음 매개변수를 입력했습니다.
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:IT
State or Province Name (full name) [Some-State]:.
Locality Name (eg, city) []:.
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Notariato
Organizational Unit Name (eg, section) []:.
Common Name (e.g. server FQDN or YOUR name) []:.*
Email Address []:[email protected]
메모:이전 답변에서는 인증서가 사용될 위치를 "무시"하기 위해 일반 이름에 와일드카드(*)를 넣었습니다. 작동할 수 있나요?
따라서 이 명령은ca.cer서버와 클라이언트 인증서를 생성하는 데 사용할 파일입니다.
나내 Apache 서버 SSL 키 및 인증서 생성: 이것은 아직 클라이언트 인증서(클라이언트가 서버에 "나는 인증된 클라이언트입니다 !!!"라고 말하기 위해 사용하는 인증서)가 아닙니다. 이것은 클라이언트에게 "나는 올바른 서버입니다"라고 말하는 서버 인증서입니다. , 중간에 사람이 없습니다." 맞습니까?
이 서버 인증서를 생성하려면 먼저 서버를 생성합니다.개인 키:
openssl genrsa -out server.key 4096
그런 다음 인증서 생성 요청을 생성하기 위해 이 서버 개인 키를 사용했습니다.
openssl req -new -key server.key -out server.req -sha256
또한 여기에서는 몇 가지 매개변수를 묻습니다.
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:IT
State or Province Name (full name) [Some-State]:.
Locality Name (eg, city) []:.
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Notariato
Organizational Unit Name (eg, section) []:.
Common Name (e.g. server FQDN or YOUR name) []:*
Email Address []:[email protected]
메모:또한 여기에는 인증서가 사용될 위치를 "무시"하기 위해 일반 이름에 와일드카드(*)를 넣었습니다. 작동할 수 있나요?
그런 다음 인증서 생성 요청과 CA 인증서를 사용하여 서버 인증서를 생성했습니다.
openssl x509 -req -in server.req -CA ca.cer -CAkey ca.key -set_serial 100 -extensions server -days 1460 -outform PEM -out server.cer -sha256
그런 다음 다음을 수행하여 Apache에 인증서를 설치하려고 합니다.
CA 인증서를 영구 위치에 복사합니다. CA 인증서는 자체 생성된 CA이고 모든 운영 체제에 포함된 CA가 아니기 때문에 Apache에서 CA 인증서를 지정해야 합니다.
cp ca.cer /etc/ssl/certs/
서버 인증서와 개인 키를 영구 위치에 복사하세요.
cp server.cer /etc/ssl/certs/server.crt cp server.key /etc/ssl/private/server.key
Apache에서 SSL 모듈을 활성화합니다.
a2enmod SSL
Apache에서 SSL 사이트를 활성화하고 HTTP 사이트를 비활성화합니다.
a2ensite 기본값-ssl a2dissite 기본값
이제 마지막 두 명령의 출력에 따라 마지막 명령에서 문제가 발생합니다.
andrea@ubuntu:~/cert$ a2ensite default-ssl
Site default-ssl already enabled
andrea@ubuntu:~/cert$ a2dissite default
ERROR: Site default does not exist!
제가 공연을 하면 보시다시피a2dissite 기본값나는 이것을 얻고 있다오류: 사이트 기본값이 존재하지 않습니다!에러 메시지.
왜? 무슨 뜻인가요? 뭐가 잘못 되었 니? 이 오류를 해결하려면 어떻게 해야 합니까?