简体   繁体   English

如何通过HTTPS / SSL连接到Soap Web服务?

[英]How to connect to a soap webservice via HTTPS/SSL?

I want to connect to a soap-webservice thatis accessed via https and provides a SSL-Server-Certificate TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS 1.2 . 我想连接到通过https访问的soap-webservice ,并提供SSL-Server-Certificate TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS 1.2

Via webbrowser, I'm asked to accept the certificate before I can view the wsdl. 通过Web浏览器,要求我接受证书,然后才能查看wsdl。

How can I implement this in java, using cxf 3 and spring 4 ? 如何使用cxf 3spring 4在java中实现此功能? Probably it has to do with HTTPConduit and TLSClientParameters ? 可能与HTTPConduitTLSClientParameters吗? But I don't have any client certificate I could provide. 但是我没有可以提供的任何客户证书。

I cannot use xml-configuration files, it must be possible programmatically. 我无法使用xml配置文件,因此必须以编程方式实现。

Since your browser asks you to accept the certificate, I assume it is not signed by a trusted certificate authority. 由于您的浏览器要求您接受证书,因此我认为它不是由受信任的证书颁发机构签名的。 In that case, you need to download the certificate and import it to the Java "keystore" - the repository of trusted certificates. 在这种情况下,您需要下载证书并将其导入Java“密钥库”(受信任证书的存储库)。

See this response on how to import the certificate to the keystore. 请参阅此响应,以了解如何将证书导入密钥库。

Then, you just use the https:// protocol for your WS endpoint. 然后,只需将https://协议用于WS端点即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM