如何使用https配置jhipster

时间:2019-09-20 13:53:10

标签: java http https jhipster

我想配置jhipster以使用https。

我在应用程序父文件夹中生成了一个证书。

我把它放在我的yml中:

   port: 443
    ssl:
        key-store: keystore.p12
        key-store-password: password
        key-store-type: PKCS12
        key-alias: admodunet
       # The ciphers suite enforce the security by deactivating some old and deprecated SSL cipher, this list was tested against SSL Labs (https://www.ssllabs.com/ssltest/)
        ciphers: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 ,TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 ,TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 ,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA256,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,TLS_RSA_WITH_CAMELLIA_256_CBC_SHA,TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
    enabled-protocols: TLSv1.2
        http2:
            enabled: true 

我使用以下命令打包应用程序: mvnw -Pro clean package

然后使用以下命令启动应用程序:java -jar app.war

该应用程序仍仅在HTTP上启动。

1 个答案:

答案 0 :(得分:0)

对于生产包,您需要Maven ./mvnw -Pprod,对于gradle,它需要./gradlew -Pprod

要打包./mvnw -Pprod clean verify