如何在Spring上配置SSL / HTTPS? [英] How to configure SSL / HTTPS on Spring?

查看:810
本文介绍了如何在Spring上配置SSL / HTTPS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个需要HTTPS的Spring Java应用程序,我跟着 Spring配置SSL的指南

I'm working on a Spring Java app that requires HTTPS, and I followed Spring's guide to configure SSL.

我的application.properties文件包含以下:

My application.properties file contains the following:

server.port = 8443
server.ssl.key-store = classpath:keystore.p12
server.ssl.key-store-password = password
server.ssl.key-password = password
server.ssl.keyStoreType = JCEKS
server.ssl.keyAlias = alias

当应用程序运行时,控制台输出 Tomcat在端口上启动: 8443(https),但对服务器的任何请求都会导致 0 NO RESPONSE 状态。

When the app is run, the console outputs Tomcat started on port(s): 8443 (https), but any request to the server results in a 0 NO RESPONSE status.

我缺少什么?

推荐答案

问题似乎是指定的加密算法。我使用 keytool 生成密钥,使用 -keyalg AES 。将其更改为使用带有 -keyalg RSA 的RSA,现在可以使用。

Problem seems to be the specified encryption algorithm. I was generating the key using keytool, with -keyalg AES. Changed it to use RSA with -keyalg RSA and it works now.

这篇关于如何在Spring上配置SSL / HTTPS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆