【问题标题】:Where should the jssecacerts file be placed on Mac?jssecacerts 文件应该放在 Mac 上的什么位置?
【发布时间】:2014-12-18 09:09:47
【问题描述】:

我正在尝试将运行在 Mac OS/X 10.10 (Yosemite) 上的 Tomcat 7.0.34 中的 web 应用程序连接到安全的 AD 服务器。我收到此错误:

org.springframework.ldap.CommunicationException: qlty-test-ad:636; nested exception is javax.naming.CommunicationException: qlty-test-ad:636 [Root exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target]
at org.springframework.ldap.support.LdapUtils.convertLdapException(LdapUtils.java:100)
at org.springframework.ldap.core.support.AbstractContextSource.createContext(AbstractContextSource.java:266)
at org.springframework.ldap.core.support.AbstractContextSource.getContext(AbstractContextSource.java:106)
at org.springframework.ldap.core.support.AbstractContextSource.getReadOnlyContext(AbstractContextSource.java:125)
at org.springframework.ldap.core.LdapTemplate.executeReadOnly(LdapTemplate.java:792)
at org.springframework.ldap.core.LdapTemplate.lookup(LdapTemplate.java:822)
at org.springframework.ldap.core.LdapTemplate.lookupContext(LdapTemplate.java:1315)
at com.enonic.cms.ee.ldap.LdapConnector.lookup(LdapConnector.java:261)
at com.enonic.cms.ee.ldap.LdapRemoteUserStorePlugin.verifyConnection(LdapRemoteUserStorePlugin.java:489)
... 87 more

所以,我缺少服务器证书。我用InstallCert 下载了它并得到了 jssecacerts 文件,据我所知,我只需要将它放在我的 JVM 可以找到并使用它的文件夹中。首先我试了一下,直接在jdk中:

/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/lib/

描述表明“lib”中应该有一个“security”文件夹,但没有。我尝试创建一个,然后将 jssecacerts 文件放在这里,但没有帮助。

然后,我找到了对这个文件夹的引用:

/System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security/

它已经包含“cacerts”文件,所以我以为我在做某事,但将“jssecacerts”放在这里也无济于事。还有

/Library/Java/Home/lib/security

其中包含两个文件(“cacerts”和“jssecacerts”)的符号链接。

有人知道我应该把jssecacerts放在哪里吗?

【问题讨论】:

    标签: active-directory jvm ssl-certificate osx-yosemite ldapconnection


    【解决方案1】:

    您可以在此处找到有关 StackOverflow 的相关文章:How to obtain the location of cacerts of the default java installation?

    在 Java 1.8 上,它应该放在这个文件夹下:

    /Library/Java/JavaVirtualMachines/jdk1.8.0_xx.jdk/Contents/Home/jre/lib/security

    我没有在JDK下找到任何安全目录,但我想它使用的是与JRE相同的目录。

    在 Mac 上查找 Java:

    /usr/libexec/java_home -v 1.8

    【讨论】:

    • 这是我尝试过的。我的 JAVA_HOME 已定义。它是上面列出的第一个文件夹。 “cacerts”通过指向 /System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security 的符号链接放置在 /Library/Java/Home/lib/security 中,但由于某种原因 jssecacerts 不是加载,即使它以相同的方式放置在同一个地方。
    • 把它放在 $JAVA/HOME/jre/lib/security 下解决了这个问题。
    猜你喜欢
    • 2015-08-09
    • 1970-01-01
    • 2010-12-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-18
    • 2012-08-10
    相关资源
    最近更新 更多