Unsupported secret key algorithm
2018-03-22 本文已影响0人
三只松呀么松鼠
接手的一个项目当中用到3DES加密,项目突然爆出Unsupported secret key algorithm:DESede的错误:
java.security.NoSuchAlgorithmException:Unsupported secret key algorithm: DESede
at com.sun.crypto.provider.DHKeyAgreement.engineGenerateSecret(DHKeyAgreement.java:387)
at javax.crypto.KeyAgreement.generateSecret(KeyAgreement.java:648)





项目当时是使用Docker搭建的集群系统,JAVA环境是使用的一个官方镜像:


一个官方tomcat镜像
根据镜像ID 找到镜像的所在位置



将服务器中的当前jre下sunjce_provider.jar包中DHKeyAgreement 与 本地环境做比较发现:

无奈项目要求紧还没有闲心去深看具体的细节,最终只能将JDK的版本做了一下还原,替换成了原JDK的环境(直接把原jre/lib/整个文件夹文件进行了覆盖)服务启动测试,通过!