如何将自签名证书添加到Java信任库?

huangapple go评论95阅读模式
英文:

How to add self-signed certificate to Java truststore?

问题

如何在Java 14 jpackage中向Java信任存储中添加自签名证书?

英文:

I am trying jpackage Java 14 to package my Spring application,
I have requirement to self-sign certificate Java trust store, but I cannot find the keytool in the jpackage image.

How can I add a self-signed certificate to the Java truststore in Java 14 jpackage?

答案1

得分: 1

我得到了答案:

  1. 运行jlink命令以创建JRE
jdk-14.0.1/bin/jlink --add-modules java.sql,java.naming,java.base,java.logging,java.desktop,java.management,java.security.jgss,java.instrument --output myJRE
  1. 运行jpackage以创建镜像
jdk-14.0.1/bin/jpackage --type app-image --runtime-image myJRE --input target/ --name xxx-xxx-app --main-jar xxx-0.0.1.jar --java-options '-Dspring.config.location=/app/conf/application.properties'
英文:

I got the answer:

  1. Run jlink command to create JRE
jdk-14.0.1/bin/jlink --add-modules java.sql,java.naming,java.base,java.logging,java.desktop,java.management,java.security.jgss,java.instrument --output myJRE
  1. Run jpackage to create image
jdk-14.0.1/bin/jpackage --type app-image --runtime-image myJRE --input target/ --name xxx-xxx-app --main-jar xxx-0.0.1.jar  --java-options '-Dspring.config.location=/app/conf/application.properties'

huangapple
  • 本文由 发表于 2020年7月22日 22:54:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/63037150.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定