keytool -genkey -alias tomcat -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore keystore.p12 -validity 4000
명령어를 입력한다.
이제 모든 요청은 https를 붙여야 한다.
Bad Request
This combination of host and port requires TLS.
http로 요청하면 Bad Request가 발생한다.
https로 요청하면 이런 화면이 뜬다.
http와 https 둘 다 받을 수 있게 설정할 수 있다.
curl -I -k --http2 https://localhost:8443/hello
HTTP/2 200
content-type: text/plain;charset=UTF-8
content-length: 0
date: Sun, 21 Aug 2022 05:55:31 GMT