【问题标题】:How to configure the jboss server to read a client certificate如何配置 jboss 服务器以读取客户端证书
【发布时间】:2012-09-25 10:57:26
【问题描述】:

我有一个 PKCS12 密钥库文件。我已经在我的浏览器中导入了它。在我的代码中,我必须检索证书信息和数据。

在 JBOSS EAP 5.1 中是否需要进行任何配置?

    HttpServletRequest req=(HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
    response.setContentType("text/plain");
    PrintWriter out = response.getWriter();
    X509Certificate[] certs = (X509Certificate[]) req.getAttribute("javax.servlet.request.X509Certificate");    
    if (certs != null) {
    for (int i = 0; i < certs.length; i++) {
    out.println("Client Certificate [" + i + "] = " + certs[i].toString());
    }
    }
    else {
    if ("https".equals(request.getScheme())) {
    out.println("This was an HTTPS request, but no client certificate is available");
    }   

在运行时。线

X509Certificate[] certs = (X509Certificate[]) req.getAttribute("javax.servlet.request.X509Certificate");    

每次都给 null。

【问题讨论】:

    标签: jboss client-certificates


    【解决方案1】:

    您确定客户正在出示证书吗?

    这可能不是您想要做的,但我在 AS 7 中使用standalone.xml 中配置的安全域做了类似的事情

    这个帖子几乎解释了这一切: https://community.jboss.org/thread/172052?start=0&tstart=0

    【讨论】:

      猜你喜欢
      • 2012-04-10
      • 2015-09-27
      • 1970-01-01
      • 1970-01-01
      • 2014-09-05
      • 1970-01-01
      • 1970-01-01
      • 2013-01-23
      • 2015-10-20
      相关资源
      最近更新 更多