使用ANT生成证书的时候出错

发布于 2021-11-16 17:21:27 字数 30758 浏览 920 评论 1

我想使用Ant生成CA证书,在做好build.xml,写好./bin/cli.xml

执行脚本时出现

     [java] Initializing CA
     [java] Generating rootCA keystore:
     [java] CA name: AdminRootCA
     [java] SuperAdmin CN: SuperAdmin
     [java] DN: CN=AdminRootCA,OU=SSLVPN CA Center,O=China Mobile Group Guangdong Co., Ltd,C=CN
     [java] CA token type: soft
     [java] CA token password: hidden
     [java] Keytype: RSA
     [java] Keyspec: 2048
     [java] Validity (days): 3650
     [java] Policy ID: null
     [java] Signature alg: SHA1WithRSA
     [java] Certificate profile: ROOTCA
     [java] CA token properties: null
     [java] Signed by: self signed
     [java] Initalizing authorization module with caid=548590678 and superadmin CN 'SuperAdmin'.
     [java] principal=sslvpnuser
     [java] credentials=pwd
     [java] security_enable=false
     [java]
     [java] javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: linux-fud5; nested exception is:
     [java]     java.net.ConnectException: Connection refused]
     [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:839)
     [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
     [java]     at javax.naming.InitialContext.lookup(InitialContext.java:392)
     [java]     at org.cesecore.jndi.JndiHelper.getRemoteSession(JndiHelper.java:81)
     [java]     at org.ejbca.core.model.util.EjbRemoteHelper.getComplexAccessControlSession(EjbRemoteHelper.java:126)
     [java]     at org.ejbca.ui.cli.ca.BaseCaAdminCommand.initAuthorizationModule(BaseCaAdminCommand.java:167)
     [java]     at org.ejbca.ui.cli.ca.CaInitCommand.execute(CaInitCommand.java:212)
     [java]     at org.ejbca.ui.cli.EjbcaEjbCli.executeCommand(EjbcaEjbCli.java:118)
     [java]     at org.ejbca.ui.cli.EjbcaEjbCli.main(EjbcaEjbCli.java:80)
     [java] Caused by: java.rmi.ConnectException: Connection refused to host: linux-fud5; nested exception is:
     [java]     java.net.ConnectException: Connection refused
     [java]     at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
     [java]     at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
     [java]     at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
     [java]     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110)
     [java]     at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
     [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
     [java]     ... 8 more
     [java] Caused by: java.net.ConnectException: Connection refused
     [java]     at java.net.PlainSocketImpl.socketConnect(Native Method)
     [java]     at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
     [java]     at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
     [java]     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
     [java]     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
     [java]     at java.net.Socket.connect(Socket.java:529)
     [java]     at java.net.Socket.connect(Socket.java:478)
     [java]     at java.net.Socket.<init>(Socket.java:375)
     [java]     at java.net.Socket.<init>(Socket.java:189)
     [java]     at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
     [java]     at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
     [java]     at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
     [java]     ... 13 more
     [java] Could not run execute method for class class org.ejbca.ui.cli.ca.CaInitCommand
     [java] org.ejbca.ui.cli.ErrorAdminCommandException: java.lang.NullPointerException
     [java]     at org.ejbca.ui.cli.ca.CaInitCommand.execute(CaInitCommand.java:324)
     [java]     at org.ejbca.ui.cli.EjbcaEjbCli.executeCommand(EjbcaEjbCli.java:118)
     [java]     at org.ejbca.ui.cli.EjbcaEjbCli.main(EjbcaEjbCli.java:80)
     [java] Caused by: java.lang.NullPointerException
     [java]     at org.ejbca.ui.cli.ca.BaseCaAdminCommand.initAuthorizationModule(BaseCaAdminCommand.java:167)
     [java]     at org.ejbca.ui.cli.ca.CaInitCommand.execute(CaInitCommand.java:212)
     [java]     ... 2 more

ejbca:initVPNRootCA:
     [echo] Initializing CA with 'VPNRootCA' 'CN=China Mobile Group Guangdong Co., Ltd. VPN Root CA,O=China Mobile Group Guangdong Co., Ltd,OU=SSLVPN CA Center,C=CN'' soft null 2048 RSA 3650 null SHA1WithRSA -superadmincn 'SuperVpnAdmin'...
     [java] Initializing CA
     [java] Generating rootCA keystore:
     [java] CA name: VPNRootCA
     [java] SuperAdmin CN: SuperVpnAdmin
     [java] DN: CN=China Mobile Group Guangdong Co., Ltd. VPN Root CA,OU=SSLVPN CA Center,O=China Mobile Group Guangdong Co., Ltd,C=CN
     [java] CA token type: soft
     [java] CA token password: hidden
     [java] Keytype: RSA
     [java] Keyspec: 2048
     [java] Validity (days): 3650
     [java] Policy ID: null
     [java] Signature alg: SHA1WithRSA
     [java] Certificate profile: ROOTCA
     [java] CA token properties: null
     [java] Signed by: self signed
     [java] Initalizing authorization module with caid=695496221 and superadmin CN 'SuperVpnAdmin'.
     [java] principal=sslvpnuser
     [java] credentials=pwd
     [java] security_enable=false
     [java]
     [java] javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: linux-fud5; nested exception is:
     [java]     java.net.ConnectException: Connection refused]
     [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:839)
     [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
     [java]     at javax.naming.InitialContext.lookup(InitialContext.java:392)
     [java]     at org.cesecore.jndi.JndiHelper.getRemoteSession(JndiHelper.java:81)
     [java]     at org.ejbca.core.model.util.EjbRemoteHelper.getComplexAccessControlSession(EjbRemoteHelper.java:126)
     [java]     at org.ejbca.ui.cli.ca.BaseCaAdminCommand.initAuthorizationModule(BaseCaAdminCommand.java:167)
     [java]     at org.ejbca.ui.cli.ca.CaInitCommand.execute(CaInitCommand.java:212)
     [java]     at org.ejbca.ui.cli.EjbcaEjbCli.executeCommand(EjbcaEjbCli.java:118)
     [java]     at org.ejbca.ui.cli.EjbcaEjbCli.main(EjbcaEjbCli.java:80)
     [java] Caused by: java.rmi.ConnectException: Connection refused to host: linux-fud5; nested exception is:
     [java]     java.net.ConnectException: Connection refused
     [java]     at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
     [java]     at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
     [java]     at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
     [java]     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110)
     [java]     at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
     [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
     [java]     ... 8 more
     [java] Caused by: java.net.ConnectException: Connection refused
     [java]     at java.net.PlainSocketImpl.socketConnect(Native Method)
     [java]     at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
     [java]     at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
     [java]     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
     [java]     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
     [java]     at java.net.Socket.connect(Socket.java:529)
     [java]     at java.net.Socket.connect(Socket.java:478)
     [java]     at java.net.Socket.<init>(Socket.java:375)
     [java]     at java.net.Socket.<init>(Socket.java:189)
     [java]     at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
     [java]     at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
     [java]     at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
     [java]     ... 13 more
     [java] Could not run execute method for class class org.ejbca.ui.cli.ca.CaInitCommand
     [java] org.ejbca.ui.cli.ErrorAdminCommandException: java.lang.NullPointerException
     [java]     at org.ejbca.ui.cli.ca.CaInitCommand.execute(CaInitCommand.java:324)
     [java]     at org.ejbca.ui.cli.EjbcaEjbCli.executeCommand(EjbcaEjbCli.java:118)
     [java]     at org.ejbca.ui.cli.EjbcaEjbCli.main(EjbcaEjbCli.java:80)
     [java] Caused by: java.lang.NullPointerException
     [java]     at org.ejbca.ui.cli.ca.BaseCaAdminCommand.initAuthorizationModule(BaseCaAdminCommand.java:167)
     [java]     at org.ejbca.ui.cli.ca.CaInitCommand.execute(CaInitCommand.java:212)
     [java]     ... 2 more
     [echo] ca getrootcert 'VPNRootCA' /opt/ejbca/p12/VPNRootCA.pem
     [java] principal=sslvpnuser
     [java] credentials=pwd
     [java] security_enable=false
     [java]
     [java] javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: linux-fud5; nested exception is:
     [java]     java.net.ConnectException: Connection refused]
     [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:839)
     [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
     [java]     at javax.naming.InitialContext.lookup(InitialContext.java:392)
     [java]     at org.cesecore.jndi.JndiHelper.getRemoteSession(JndiHelper.java:81)
     [java]     at org.ejbca.core.model.util.EjbRemoteHelper.getCaSession(EjbRemoteHelper.java:98)
     [java]     at org.ejbca.ui.cli.ca.BaseCaAdminCommand.getCertChain(BaseCaAdminCommand.java:66)
     [java]     at org.ejbca.ui.cli.ca.CaGetRootCertCommand.execute(CaGetRootCertCommand.java:53)
     [java]     at org.ejbca.ui.cli.EjbcaEjbCli.executeCommand(EjbcaEjbCli.java:118)
     [java]     at org.ejbca.ui.cli.EjbcaEjbCli.main(EjbcaEjbCli.java:80)
     [java] Caused by: java.rmi.ConnectException: Connection refused to host: linux-fud5; nested exception is:
     [java]     java.net.ConnectException: Connection refused
     [java]     at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
     [java]     at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
     [java]     at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
     [java]     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110)
     [java]     at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
     [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
     [java]     ... 8 more
     [java] Caused by: java.net.ConnectException: Connection refused
     [java]     at java.net.PlainSocketImpl.socketConnect(Native Method)
     [java]     at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
     [java]     at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
     [java]     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
     [java]     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
     [java]     at java.net.Socket.connect(Socket.java:529)
     [java]     at java.net.Socket.connect(Socket.java:478)
     [java]     at java.net.Socket.<init>(Socket.java:375)
     [java]     at java.net.Socket.<init>(Socket.java:189)
     [java]     at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
     [java]     at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
     [java]     at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
     [java]     ... 13 more
     [java] Error while getting certfificate chain from CA.
     [java] java.lang.NullPointerException
     [java]     at org.ejbca.ui.cli.ca.BaseCaAdminCommand.getCertChain(BaseCaAdminCommand.java:66)
     [java]     at org.ejbca.ui.cli.ca.CaGetRootCertCommand.execute(CaGetRootCertCommand.java:53)
     [java]     at org.ejbca.ui.cli.EjbcaEjbCli.executeCommand(EjbcaEjbCli.java:118)
     [java]     at org.ejbca.ui.cli.EjbcaEjbCli.main(EjbcaEjbCli.java:80)
     [java] No CA certificate found.

ejbca:initVPNClientRootCA:
     [echo] Initializing CA with 'VPNClientRootCA' 'CN=China Mobile Group Guangdong Co., Ltd. VPNClient Root CA,O=China Mobile Group Guangdong Co., Ltd,OU=SSLVPN CA Center,C=CN' soft null 2048 RSA 3650 null SHA1WithRSA -superadmincn 'SuperVpnClientAdmin'...
     [java] Initializing CA
     [java] Generating rootCA keystore:
     [java] CA name: VPNClientRootCA
     [java] SuperAdmin CN: SuperVpnClientAdmin
     [java] DN: CN=China Mobile Group Guangdong Co., Ltd. VPNClient Root CA,OU=SSLVPN CA Center,O=China Mobile Group Guangdong Co., Ltd,C=CN
     [java] CA token type: soft
     [java] CA token password: hidden
     [java] Keytype: RSA
     [java] Keyspec: 2048
     [java] Validity (days): 3650
     [java] Policy ID: null
     [java] Signature alg: SHA1WithRSA
     [java] Certificate profile: ROOTCA
     [java] CA token properties: null
     [java] Signed by: self signed
     [java] Initalizing authorization module with caid=-682797496 and superadmin CN 'SuperVpnClientAdmin'.
     [java] principal=sslvpnuser
     [java] credentials=pwd
     [java] security_enable=false
     [java]
     [java] javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: linux-fud5; nested exception is:
     [java]     java.net.ConnectException: Connection refused]
     [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:839)
     [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
     [java]     at javax.naming.InitialContext.lookup(InitialContext.java:392)
     [java]     at org.cesecore.jndi.JndiHelper.getRemoteSession(JndiHelper.java:81)
     [java]     at org.ejbca.core.model.util.EjbRemoteHelper.getComplexAccessControlSession(EjbRemoteHelper.java:126)
     [java]     at org.ejbca.ui.cli.ca.BaseCaAdminCommand.initAuthorizationModule(BaseCaAdminCommand.java:167)
     [java]     at org.ejbca.ui.cli.ca.CaInitCommand.execute(CaInitCommand.java:212)
     [java]     at org.ejbca.ui.cli.EjbcaEjbCli.executeCommand(EjbcaEjbCli.java:118)
     [java]     at org.ejbca.ui.cli.EjbcaEjbCli.main(EjbcaEjbCli.java:80)
     [java] Caused by: java.rmi.ConnectException: Connection refused to host: linux-fud5; nested exception is:
     [java]     java.net.ConnectException: Connection refused
     [java]     at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
     [java]     at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
     [java]     at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
     [java]     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110)
     [java]     at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
     [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
     [java]     ... 8 more
     [java] Caused by: java.net.ConnectException: Connection refused
     [java]     at java.net.PlainSocketImpl.socketConnect(Native Method)
     [java]     at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
     [java]     at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
     [java]     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
     [java]     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
     [java]     at java.net.Socket.connect(Socket.java:529)
     [java]     at java.net.Socket.connect(Socket.java:478)
     [java]     at java.net.Socket.<init>(Socket.java:375)
     [java]     at java.net.Socket.<init>(Socket.java:189)
     [java]     at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
     [java]     at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
     [java]     at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
     [java]     ... 13 more
     [java] Could not run execute method for class class org.ejbca.ui.cli.ca.CaInitCommand
     [java] org.ejbca.ui.cli.ErrorAdminCommandException: java.lang.NullPointerException
     [java]     at org.ejbca.ui.cli.ca.CaInitCommand.execute(CaInitCommand.java:324)
     [java]     at org.ejbca.ui.cli.EjbcaEjbCli.executeCommand(EjbcaEjbCli.java:118)
     [java]     at org.ejbca.ui.cli.EjbcaEjbCli.main(EjbcaEjbCli.java:80)
     [java] Caused by: java.lang.NullPointerException
     [java]     at org.ejbca.ui.cli.ca.BaseCaAdminCommand.initAuthorizationModule(BaseCaAdminCommand.java:167)
     [java]     at org.ejbca.ui.cli.ca.CaInitCommand.execute(CaInitCommand.java:212)
     [java]     ... 2 more
     [echo] ca getrootcert 'VPNClientRootCA' /opt/ejbca/p12/VPNClientRootCA.pem
     [java] principal=sslvpnuser
     [java] credentials=pwd
     [java] security_enable=false
     [java]
     [java] javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: linux-fud5; nested exception is:
     [java]     java.net.ConnectException: Connection refused]
     [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:839)
     [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
     [java]     at javax.naming.InitialContext.lookup(InitialContext.java:392)
     [java]     at org.cesecore.jndi.JndiHelper.getRemoteSession(JndiHelper.java:81)
     [java]     at org.ejbca.core.model.util.EjbRemoteHelper.getCaSession(EjbRemoteHelper.java:98)
     [java]     at org.ejbca.ui.cli.ca.BaseCaAdminCommand.getCertChain(BaseCaAdminCommand.java:66)
     [java]     at org.ejbca.ui.cli.ca.CaGetRootCertCommand.execute(CaGetRootCertCommand.java:53)
     [java]     at org.ejbca.ui.cli.EjbcaEjbCli.executeCommand(EjbcaEjbCli.java:118)
     [java]     at org.ejbca.ui.cli.EjbcaEjbCli.main(EjbcaEjbCli.java:80)
     [java] Caused by: java.rmi.ConnectException: Connection refused to host: linux-fud5; nested exception is:
     [java]     java.net.ConnectException: Connection refused
     [java]     at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
     [java]     at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
     [java]     at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
     [java]     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110)
     [java]     at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
     [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
     [java]     ... 8 more
     [java] Caused by: java.net.ConnectException: Connection refused
     [java]     at java.net.PlainSocketImpl.socketConnect(Native Method)
     [java]     at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
     [java]     at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
     [java]     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
     [java]     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
     [java]     at java.net.Socket.connect(Socket.java:529)
     [java]     at java.net.Socket.connect(Socket.java:478)
     [java]     at java.net.Socket.<init>(Socket.java:375)
     [java]     at java.net.Socket.<init>(Socket.java:189)
     [java]     at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
     [java]     at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
     [java]     at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
     [java]     ... 13 more
     [java] Error while getting certfificate chain from CA.
     [java] java.lang.NullPointerException
     [java]     at org.ejbca.ui.cli.ca.BaseCaAdminCommand.getCertChain(BaseCaAdminCommand.java:66)
     [java]     at org.ejbca.ui.cli.ca.CaGetRootCertCommand.execute(CaGetRootCertCommand.java:53)
     [java]     at org.ejbca.ui.cli.EjbcaEjbCli.executeCommand(EjbcaEjbCli.java:118)
     [java]     at org.ejbca.ui.cli.EjbcaEjbCli.main(EjbcaEjbCli.java:80)
     [java] No CA certificate found.


 

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

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

发布评论

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

评论(1

清风夜微凉 2021-11-17 01:14:10

Connection refused to host: linux-fud5

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