在文献资料中,server.ssl.protocol
的默认值是TLS
,但它没有指定将使用哪个版本。
我读到TLS1.3可以从java 11开始使用,但是在Sprint可用时它是否默认使用呢?
是否有任何配置可以告诉我在我的项目中使用哪个版本?
或者任何依赖于Spring引导版本的文档,这些文档可以告诉框架使用的TLS版本吗?
发布于 2022-11-09 15:18:37
我使用的是SpringBoot2.7.3和JDK 17,默认情况下,它支持TLSv1.3
您可以通过运行下面的命令来检查这一点。我的应用程序在8080端口上本地运行,所以我在-connect
之后通过了-connect
。
openssl s_client -connect 127.0.01:8080
输出
CONNECTED(00000003)
140704377439424:error:1404B42E:SSL routines:ST_CONNECT:tlsv1 alert protocol version:/AppleInternal/Library/BuildRoots/810eba08-405a-11ed-86e9-6af958a02716/Library/Caches/com.apple.xbs/Sources/libressl/libressl-3.3/ssl/tls13_lib.c:151:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 5 bytes and written 294 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.3
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
Start Time: 1668006818
Timeout : 7200 (sec)
Verify return code: 0 (ok)
---
可以通过此属性更改TLS版本。
server.ssl.enabled-protocols=TLSv1.2
想看更多关于这个的书吗?请参阅下面的链接
https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto.webserver.configure-ssl
https://stackoverflow.com/questions/74372881
复制相似问题