Skip to content

Instantly share code, notes, and snippets.

@lesstif
Last active October 8, 2021 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lesstif/98ab571ccbc3f135b0f2c91910c53185 to your computer and use it in GitHub Desktop.
Save lesstif/98ab571ccbc3f135b0f2c91910c53185 to your computer and use it in GitHub Desktop.
Let's encrypt + nginx 에서 HPKP(Http Public Key Pinning) 활성화하기

SSL 인증서내 SPKI(Subject 구하기)

lesstif.com 은 SPKI 를 추출할 사이트 주소로 변경

openssl s_client -servername lesstif.com -connect lesstif.com:443 | \
openssl x509 -pubkey -noout | \
openssl rsa -pubin -outform der | \
openssl dgst -sha256 -binary | \
openssl enc -base64

출력값중 중 맨 뒤의 base64 문자열(kaMrKs...Lg=) 을 hash1 이라고 정의

depth=2 C = US, O = Internet Security Research Group, CN = ISRG Root X1
verify return:1
depth=1 C = US, O = Let's Encrypt, CN = R3
verify return:1
depth=0 CN = lesstif.com
verify return:1
writing RSA key
kaMrKsD+ugAwHluGEVDCJFHErLag/EfDwR87vaZm+Lg=

SSL 인증서내 SPKI(Subject 구하기)

Ref

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment