JAVA/SPRING

HTTP2로 요청을 보내보자

gracelove91 2020. 1. 29. 16:53
  1. 먼저 인증서를 만들자.

    • 터미널에서 다음과 같이 입력한다.
      • keytool -genkey -alias gracelove -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore keystore.p12 -validity 4000
  2. application.properties 에 다음과 같이 적절한 값을 넣어준다.

  3. 컨트롤러를 만들자.

  4. 터미널에서 curl 로 요청을 보내보자

    • curl -I -k --url https://localhost:8443/hello
    • 리스폰스라인을 보면 HTTP2로 통신한 것을 볼 수 있다

 

참고소스. https://github.com/gracelove91/springboot-with-whiteship/tree/453045f3aa4496822181375fa208b244d4321a9c