1. 程式人生 > >Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [271] milliseconds.

Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [271] milliseconds.

java sdn regexp 但是 tomcat環境 details https security 文件

翻譯過來是:使用[SHA1PRNG]創建用於會話ID生成的SecureRandom實例花費了[271]毫秒。

1/[SHA1PRNG] java的一個基於SHA-1算法實現且保密性較強的偽隨機數生成器,詳見java.security.SecureRandom()

找到兩種解決辦法/https://blog.csdn.net/u011627980/article/details/54024974:

1)在Tomcat環境中解決

可以通過配置JRE使用非阻塞的Entropy Source。

在catalina.sh中加入這麽一行:-Djava.security.egd=file:/dev/./urandom 即可。

加入後再啟動Tomcat,整個啟動耗時下降到Server startup in 2912 ms。

2)在JVM環境中解決

打開$JAVA_PATH/jre/lib/security/java.security這個文件,找到下面的內容:

securerandom.source=file:/dev/urandom

替換成

securerandom.source=file:/dev/./urandom

但是都不奏效,後來發現本地環境jdk是1.8,jre是1.7
全部卸載後安裝同一版本。最後work...


Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [271] milliseconds.