我有IBM WAS 8.5.5.9 ND和MS Exchange服务器,我尝试使用EWS Java API访问它。部署管理器设置在一台计算机上,我的带有Java应用程序的应用程序服务器在其他计算机上运行。
ExchangeService service = new ExchangeService();
ExchangeCredentials credentials = new WebCredentials("username", "password", "host");
service.setCredentials(credentials);
service.setUrl(URI.create("https://xxxxxxxxx/EWS/Exchange.asmx"));
List msgList = new ArrayList();
Folder folder = Folder.bind(service, WellKnownFolderName.Inbox);
FindItemsResults results = service.findItems(folder.getId(), new ItemView(5));
List items = results.getItems();
service.close();
但我的应用程序未能加入MS Exchange。 HTTPS连接问题:
The request failed. The request failed. com.ibm.jsse2.util.j: PKIX path building failed: java.security.cert.CertPathBuilderException: PKIXCertPathBuilderImpl could not build a valid CertPath.; internal cause is:
java.security.cert.CertPathValidatorException: The certificate issued by CN=XXX Root CA, O=XXX, C=ES is not trusted; internal cause is:
java.security.cert.CertPathValidatorException: Certificate chaining error
我已经创建了这个IBM指南(http://www-01.ibm.com/support/docview.wss?uid=swg21592616)。
我从我的firefox浏览器下载了根证书和中间证书,我可以使用它来加入OWA。将它们安装在NodeDefaultTrustStore中,甚至安装在CellDefaultTrustStore中,重新加载我的app服务器,并在其上运行java EWS API。但仍有这个问题。
我做错了什么?也许我错过了什么?此问题是否与IBW WAS和信任库设置相关联,或者我只是有错误的证书? Shoul我把这个证书添加到java truststore?添加歌手证书时Alias字段的值是否重要(除了 trusted 之外,我为中间证书设置了别名值)?
答案 0 :(得分:1)
要解决此问题,我还必须在java truststore中添加根证书和中间证书