我调用EJBCA服务的代码如下
CryptoProviderTools.installBCProvider();
String keyStorePath ="C:/softwares/ejbca/ejbca_ce_6_2_0/p12/superadmin.p12";
String password = "ejbca";
final String urlstr = "https://localhost:8443/ejbca/ejbcaws/ejbcaws?wsdl";
System.setProperty("javax.net.ssl.keyStoreType", "pkcs12");
System.setProperty("javax.net.ssl.keyStore", keyStorePath);
System.setProperty("javax.net.ssl.keyStorePassword", password);
System.setProperty("javax.net.ssl.trustStore", "C:/softwares/ejbca/ejbca_ce_6_2_0/p12/truststore.jks");
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
final Provider tlsProvider = new TLSProvider();
Security.addProvider(tlsProvider);
Security.setProperty("ssl.TrustManagerFactory.algorithm", "AcceptAll");
Security.setProperty("ssl.KeyManagerFactory.algorithm", "NewSunX509");
final QName qname = new QName("http://ws.protocol.core.ejbca.org/", "EjbcaWSService");
final EjbcaWSService service = new EjbcaWSService(new URL(urlstr), qname);
ejbcaraws = service.getEjbcaWSPort();
此程序在独立程序中运行顺利,但在Web应用程序中出现以下错误时失败:
javax.xml.ws.WebServiceException:无法访问WSDL: https://localhost:8443/ejbca/ejbcaws/ejbcaws?wsdl。它失败了: 获得软件导致连接中止:打开流时recv失败 来自https://localhost:8443/ejbca/ejbcaws/ejbcaws?wsdl。
我尝试搜索其他主题,但我没有得到具体的解决方案。 能否请您解决如何纠正这个问题?