letsencrypt 및 certbot을 사용하여 기존 인증서에 메일 서버를 어떻게 추가합니까?

letsencrypt 및 certbot을 사용하여 기존 인증서에 메일 서버를 어떻게 추가합니까?

주인:디지털 오션

운영체제:CentOS

내 도메인에 적용되는 기존 SSL 인증서가 있습니다.

$ certbot certificates이 출력을 생성합니다.

Found the following certs:
   Certificate Name: example.com
     Domains: example.com www.example.com
     Expiry Date: 2020-04-12 21:20:31+00:00 (VALID: 86 days)
     Certificate Path: /etc/letsencrypt/live/example.com/fullchain.pem
     Private Key Path: /etc/letsencrypt/live/example.com/privkey.pem

설치했고 postfix추가해야 한다고 생각합니다.mail.example.com내 인증서에.

추가하려고했는데mail.example.com이 명령을 사용하여 내 인증서에

$ sudo certbot certonly --standalone -d mail.example.com

불행하게도 이런 오류가 발생했습니다.

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for mail.example.com
Waiting for verification…
Challenge failed for domain mail.example.com
http-01 challenge for mail.example.com
Cleaning up challenges
Some challenges have failed.

IMPORTANT NOTES:

The following errors were reported by the server:

Domain: mail.example.com
Type: dns
Detail: DNS problem: NXDOMAIN looking up A for mail.example.com

certbot이 설치를 시도하는 것 같습니다mail.example.comA 레코드를 사용합니다. 내 도메인 레코드 섹션의 Digital Oceanmail.example.comA 레코드가 아닌 MX 레코드로 생성되었습니다.

답변1

맞습니다. 메일 배달을 위해서는 MX 항목이 필요합니다. 하지만: mail.testsite.com은 정규화된 호스트 이름입니다. 그리고 메일을 배달하려는 모든 사람에게 이 호스트 이름의 IP 주소가 무엇인지 알려주어야 합니다. 따라서 메일을 받을 서버를 가리키는 A 레코드도 필요합니다.

레코드를 생성하고 메일 서버를 가리키고 해당 시스템에서 certbot을 실행하십시오. 확인이 성공하려면 웹 서버가 mail.testsite.com에 대해 포트 80에서 응답하는지 확인하십시오. 그러면 작동할 것입니다.

답변2

다음과 같이 하세요:

$ sudo certbot -d mail.example.com --manual --preferred-challenges dns certonly

DNS TXT 레코드가 인쇄됩니다(클릭하지 마세요).입력하다아직), 이를 DNS에 게시하고 DNS 외부에서 TXT 레코드를 읽을 수 있다고 확신할 때까지 기다린 다음 클릭하세요.입력하다그리고 확인될 것입니다.

답변3

Ionos가 DNS 공급자이고 메일 서버 mail.example.com을 호출하는 일반적인 규칙을 따르는 경우 A 레코드 "mail"과 MX 레코드 "mail"을 만드는 것만으로는 충분하지 않습니다. TXT 레코드가 certbot을 충족하지 않습니다.

다음을 생성해야 합니다.하위 도메인Ionos UI를 사용하여 "메일"이라고 합니다. 그런 다음 UI에서 해당 하위 도메인으로 이동하여 TXT 레코드를 생성하고 이름을 "_acme-challenge"로 지정할 수 있습니다. 그러면 작동하는 "_acme-challenge.mail.example.com" TXT 레코드가 생성됩니다.

향후 문의를 위해 남겨 두는 것이 좋습니다

certbot을 실행할 때마다 챌린지의 가치가 바뀌는 것처럼 보입니다. 따라서 TXT 레코드를 그대로 둘 수 있지만 매번 편집해야 합니다.

관련 정보