jks转换为pem,给nginx配置

最近需要将jdk中使用keytool生成的jks转换为pem,再给nginx配置。
由于jks不能直接转换为pem,需要二次转换。于是我先使用了keytool -importkeystore -srckeystore myssl.jks -srcalias myssl -destkeystore myssl.p12 -deststoretype PKCS12命令转换为了p12,再将p12转换为pem。可当我使用openssl pkcs12 -nodes -in myssl.p12 -out myssl.pem命令进行转换时,报出了如下错误:
Error outputting keys and certificates
84690000:error:0308010C:digital envelope routines:inner_evp_generic_fetch:unsupported:crypto\evp\evp_fetch.c:349:Global default library context, Algorithm (RC2-40-CBC : 0), Properties ()
在网上查阅许久也没有找到相关的问题,有朋友知道吗?

你可以尝试转换成 crt和key文件来
可参考:https://blog.csdn.net/liuchuan_com/article/details/54376258


至于转成pem,你的命令有问题,
可参考:https://blog.csdn.net/zhaofuqiangmycomm/article/details/121980245


直接转成crt来吧,平时都是这样用。