如何在更新期间保留 Mac 上的 CAcerts 密钥库?

发布于 2024-10-07 01:22:46 字数 244 浏览 4 评论 0原文

Mac OS X 的 CA 密钥库位于 /System/Library/Frameworks/JavaVM.framework/Home/lib/security/cacerts 中。这个密钥库似乎会被每次 Java 更新覆盖,这非常烦人,因为我们有用于开发环境、测试的内部 CA……

是否有一种方法可以跨 Apple JSR 保留密钥库更改,现在,使用 Snow Leo JSR3,也可以跨更新单独的 Java 开发人员包(其 JDK 使用相同的密钥库)?

Mac OS X has the CA keystore in /System/Library/Frameworks/JavaVM.framework/Home/lib/security/cacerts. This keystore seems to be overwritten by every Java update, which is very annoying since we have internal CAs for development environments, testing…

Is there a way to preserve keystore changes across Apple JSRs, and now, with Snow Leo JSR3, also across updates for the separate Java developer packages (whose JDKs use the same keystore)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

深海夜未眠 2024-10-14 01:22:46

[这是过时的信息 - 请参阅下面 10.6+ 的答案]

/System/Library/Frameworks/JavaVM.framework/Home/ 是到 Versions/CurrentJDK/Home 的符号链接JavaVM.framework 内。显然,这将随着新版本而改变。使用完整路径(例如/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home),并且它不会随着更新而改变。

[ This is outdated info - see the answer below for 10.6+ ]

/System/Library/Frameworks/JavaVM.framework/Home/ is a symlink to Versions/CurrentJDK/Home within JavaVM.framework. Obviously this will change with a new Version. Use the full path (e.g. /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home) and it won't change across updates.

苍景流年 2024-10-14 01:22:46

以下参数可用于指定 java cacerts 文件的位置:

-Djavax.net.ssl.trustStore=<cacerts.location>
-Djavax.net.ssl.trustStorePassword=changeit

在 java 主目录(带有内部 CA)中制作 cacerts 的副本,并将其放在主目录中的某个位置。然后将 cacerts 文件位置的完整路径作为上面 javax.net.ssl.trustStore 属性的值。该副本不会被 Java 更新覆盖。默认密码是“changeit”。

这种方法的两个缺点是:

  • 您的文件不会获得 sdk 中 cacerts 文件的任何更新。如果证书颁发机构受到损害,这主要是一个问题。
  • 在任何需要自定义证书(构建工具、应用程序服务器等)的地方,都需要指定这些参数。

The following parameters can be used to specify the location of the cacerts file to java:

-Djavax.net.ssl.trustStore=<cacerts.location>
-Djavax.net.ssl.trustStorePassword=changeit

Make a copy of the cacerts in the java home directory (with internal CAs) and put it somewhere in your home directory. Then put the full path to the cacerts file location as the value of javax.net.ssl.trustStore property above. That copy will not get overwritten by Java updates. The default password is 'changeit'.

Two downsides to this approach are:

  • Your file won't get any updates to the cacerts file in the sdk. This is primarily an issue if a certificate authority is compromised.
  • Everywhere you need the custom cacerts (build tools, app server, etc), these parameters need to be specified.
匿名的好友 2024-10-14 01:22:46

Mac OS X 10.6.8 Snow Leopard 中的情况似乎有所改变。现在 /System/Library/Frameworks/JavaVM.framework/Home/lib/security/cacerts/System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/ 的符号链接lib/security/cacerts,如果幸运的话,它不会在更新时改变。

It seems things have changed in Mac OS X 10.6.8 Snow Leopard. Now /System/Library/Frameworks/JavaVM.framework/Home/lib/security/cacerts is a symlink to /System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security/cacerts, which won't change on updates, if we're lucky.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文