MacOS로 인증서 만들기
2010/12/01 추기
certbot
가 없다.전제 조건
Certbot 설치
명령줄에 Let's Encerypt를 생성하는 인증서Certbot를 설치합니다.
brew install certbot
# version
certbot --version
certbot 1.9.0
※ 이 환경에서 도중에emacs 관련 오류가 발생했습니다.==> Installing emacs
==> Pouring emacs-27.1.catalina.bottle.tar.gz
==> Caveats
To have launchd start emacs now and restart at login:
brew services start emacs
Or, if you don't want/need a background service you can just run:
emacs
==> Summary
🍺 /usr/local/Cellar/emacs/27.1: 4,009 files, 104.0MB
Removing: /usr/local/Cellar/emacs/26.3... (3,986 files, 101.4MB)
==> Checking for dependents of upgraded formulae...
Error: No such file or directory - /usr/local/Cellar/emacs/26.3
아래의 대응 방식을 통해 제거한다.# すでに emacs は入っていたため依存関係を無視して一旦アンインストール
brew uninstall --ignore-dependencies emacs
# 再度 certbot をインストール
# `install` だと `To reinstall 1.9.0, run `brew reinstall certbot` となったので `reinstall` を使用
brew reinstall certbot
증명서를 발행하다
1. 인증서 발급 명령 실행
# 発行したいドメインを指定する
# ex: example.com
sudo certbot certonly --manual --domain example.com
Password: # パスワード入力
2. 대화식 질문에 답하기
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator manual, Installer None
Enter email address (used for urgent renewal and security notices)
(Enter 'c' to cancel): # メールアドレス(後で非公開にするから何でもいい)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A # 利用規約に同意する
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let's Encrypt project and the non-profit organization that
develops Certbot? We'd like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: N # メールアドレスを公開しないにしておく
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NOTE: The IP of this machine will be publicly logged as having requested this
certificate. If you're running certbot in manual mode on a machine that is not
your server, please ensure you're okay with that.
Are you OK with your IP being logged?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y # IPアドレスのロギング
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Create a file containing just this data:
# ランダムな文字列1
And make it available on your web server at this URL:
http://example.com/.well-known/acme-challenge/# ランダムな文字列2
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Press Enter to Continue
3. 도메인 이름 소유 확인
아래의 대응을 실시하여 발행하고자 하는
example.com
역을 확인한다.http://example.com/.well-known/acme-challenge/
아래 ランダムな文字列2
의 파일 이름으로 파일을 설정하고 ランダムな文字列1
를 내용으로 저장합니다.Enter
를 누릅니다.4. 생성된 인증서 파일 확인
Waiting for verification...
Cleaning up challenges
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/example.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/example.com/privkey.pem
Your cert will expire on 2021-01-18. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew *all* of your certificates, run
"certbot renew"
- Your account credentials have been saved in your Certbot
configuration directory at /etc/letsencrypt. You should make a
secure backup of this folder now. This configuration directory will
also contain certificates and private keys obtained by Certbot so
making regular backups of this folder is ideal.
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
성공하면 다음과 같은 파일을 생성합니다./etc/letsencrypt/live/example.com/fullchain.pem
/etc/letsencrypt/live/example.com/privkey.pem
/etc/letsencrypt/live/example.com/
아래에 다른 서류가 있습니다./etc/letsencrypt/live/example.com/cert.pem
/etc/letsencrypt/live/example.com/chain.pem
5. 서버에 인증서 설정 및 동작 확인
위에서 생성한 인증서 파일을 서버에 설정하여 작업을 검사합니다.
예:nginx에서 설정합니다.
SSL 관련 디렉토리는 각각 다음 파일을 설정하면 됩니다.
cert.pem
fullchain.pem
privkey.pem
참고 자료
Reference
이 문제에 관하여(MacOS로 인증서 만들기), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://zenn.dev/dai0916/articles/58923df5c8e8818d02f7텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)