Spring Boot 2 SSL和Http 2配置

生成自签名证书

keytool -genkey -alias tomcat -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore keystore.p12 -validity 3650

application.xml配置

server:

  http2:

    enabled: true

  ssl:

    enabled: true

    key-store: classpath:keystore.p12

    key-store-password: 123456

    key-store-type: PKCS12

    key-alias: tomcat

  compression:

    enabled: true

    mime-types: application/json,application/xml,text/html,text/javascript,text/css,text/xml,text/plain

    min-response-size: 2048

  tomcat:

    accept-count: 400

    uri-encoding: utf-8

    min-spare-threads: 25

    max-threads: 400

  connection-timeout: 20000

你可能感兴趣的:(Spring Boot 2 SSL和Http 2配置)