已弃用 Spring Boot 应用程序的 java.security.egd=file:/dev/./urandom?

Posted

技术标签:

【中文标题】已弃用 Spring Boot 应用程序的 java.security.egd=file:/dev/./urandom?【英文标题】:Deprecated java.security.egd=file:/dev/./urandom for Spring Boot applications? 【发布时间】:2020-04-21 04:09:40 【问题描述】:

我曾经在我的 Dockerfile 中为 Spring Boot 应用程序配置 -Djava.security.egd=file:/dev/./urandom

在https://spring.io/guides/gs/spring-boot-docker/ 中添加了一条评论,表明新版本不再需要这样做:

为了减少 Tomcat 启动时间,我们添加了一个指向“/dev/urandom”的系统属性作为熵源。如果您使用“标准”版本的 Tomcat(或任何其他 Web 服务器),则对于较新版本的 Spring Boot,这不是必需的。

我正在 Tomcat 或 Spring Boot 存储库中寻找有关此更改的任何参考,以及哪些 Spring Boot 版本受到影响。

【问题讨论】:

【参考方案1】:

这个问题应该已经被 JDK Enhancement Proposal 解决了:JEP 123, Configurable Secure Random-Number Generation。

根据JDK 8 Security Enhancements 官方Oracle 文档,/dev/./urandom 解决方法从 JDK 8 开始不再需要。

修复了 SHA1PRNG 和 NativePRNG 以正确尊重 java.security 文件中的 SecureRandom 种子源属性。 (不再需要使用 file:///dev/urandom 和 file:/dev/./urandom 的晦涩解决方法。)

【讨论】:

以上是关于已弃用 Spring Boot 应用程序的 java.security.egd=file:/dev/./urandom?的主要内容,如果未能解决你的问题,请参考以下文章

Spring Ldap PasswordEncoder 已弃用替代方案

Java Spring Security - User.withDefaultPasswordEncoder() 已弃用?

JdbcTemplate queryForInt / Long在Spring 3.2.2中已弃用。应该用什么代替?

JedisConnectionFactory setHostName 已弃用

HttpServer tcpConfiguration 已弃用

Spring Tool Suite 4 - 是否已弃用Pivotal tc服务器?