javax.servlet.request.X509Certificate属性返回null

时间:2019-06-13 10:54:09

标签: java ssl client-certificates tomee-7

ContainerRequestFilter中,我试图读取客户的自签名证书,但我得到的是空值。

Java:

X509Certificate[] certificates = (X509Certificate[]) requestContext.getProperty("javax.servlet.request.X509Certificate");

Tomee server.xml:

<Connector port="8443"
    protocol="org.apache.coyote.http11.Http11NioProtocol"
    maxThreads="150" SSLEnabled="true" scheme="https"
    secure="true" maxPostSize="100000"
    >
    <SSLHostConfig
    certificateVerification="optionalNoCA"
    truststoreFile="/my/java/cacerts"
    truststorePassword="changeit"
    >
    <Certificate
            certificateKeyAlias="myalias"
            certificateKeystoreFile="/my/keystore/filepath"
            certificateKeystorePassword="changeit"
            certificateKeystoreType="JKS" >
    </Certificate>
    </SSLHostConfig>

我缺少什么配置?

0 个答案:

没有答案