如何在glassfish 3.1.2.2上安装ssl

时间:2013-07-11 07:51:13

标签: java ssl install glassfish-3 keytool

如何在glassfish 3.1.2.2上安装ssl?

我已经拥有root和intermediate的证书。证书准备就绪。

问题是如何安装它?我已经按照http://javadude.wordpress.com/2010/04/06/getting-started-with-glassfish-v3-and-ssl/http://eugenedvorkin.com/installing-thawte-certificate-on-glassfish-3-11-server-for-https-traffic/

的指南进行操作了

但仍然失败,这是我试图做的。

  1. keytool -genkeypair -keyalg RSA -keystore keystore.jks -keypass changeit -storepass changeit -alias s1as

  2. keytool -certreq -alias s1as -file s1as.csr -keystore keystore.jks -storepass changeit

  3. keytool -import -v -trustcacerts -alias s1as -file root.crt -keystore cacerts.jks -storepass changeit

  4. keytool -import -v -trustcacerts -alias Intermediate -file intermediate.crt -keystore cacerts.jks -storepass changeit

  5. 在此步骤4之后,它将创建keystore.jkscacerts.jks。之后,我将这2个文件复制到glassfish-3.1.2.2\glassfish\domains\domain1\config

    打开管理控制台并设置为http侦听器2,

    • 证书NickName:keystore
    • 密钥库:keystore.jks
    • 信任算法:sha1
    • 最长证书长度:5
    • Trust Store:cacerts.jks

    但是当我访问https:\ localhost:8181

    >WARNING: GRIZZLY0007: SSL support could not be configured!
    java.io.IOException: sha1 TrustManagerFactory not available
        at com.sun.grizzly.util.net.jsse.JSSE14SocketFactory.init(JSSE14SocketFactory.java:188)
        at com.sun.grizzly.config.SSLConfigHolder.initializeSSL(SSLConfigHolder.java:363)
        at com.sun.grizzly.config.SSLConfigHolder.configureSSL(SSLConfigHolder.java:241)
        at com.sun.grizzly.config.GrizzlyEmbeddedHttps$LazySSLInitializationFilter.execute(GrizzlyEmbeddedHttps.java:202)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
        at java.lang.Thread.run(Thread.java:722)
    
    >SEVERE: ProtocolChain exception
    java.lang.NullPointerException
        at com.sun.grizzly.filter.SSLReadFilter.newSSLEngine(SSLReadFilter.java:352)
        at com.sun.grizzly.filter.SSLReadFilter.obtainSSLEngine(SSLReadFilter.java:399)
        at com.sun.grizzly.filter.SSLReadFilter.execute(SSLReadFilter.java:159)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
        at java.lang.Thread.run(Thread.java:722)
    
    >SEVERE: ProtocolChain exception
    java.lang.NullPointerException
        at com.sun.grizzly.filter.SSLReadFilter.newSSLEngine(SSLReadFilter.java:352)
        at com.sun.grizzly.filter.SSLReadFilter.obtainSSLEngine(SSLReadFilter.java:399)
        at com.sun.grizzly.filter.SSLReadFilter.execute(SSLReadFilter.java:159)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
        at java.lang.Thread.run(Thread.java:722)
    

    有人帮我解决这个问题吗? Thx b4

1 个答案:

答案 0 :(得分:0)

此配置适用于我:

(在http-listener-2的SSL选项卡上)

  • SSL3 - [已启用]
  • TLS - [已启用]
  • 客户端身份验证 - [已启用]
  • 证书NickName:s1as
  • 钥匙店:[空]
  • 信任算法:[空]
  • 最长证书长度:5
  • 信任商店:[空]

  • 密码套房:[全选]

希望它有所帮助。