summaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/util/client/mzs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/gv/util/client/mzs')
-rw-r--r--src/main/java/at/gv/util/client/mzs/MOAZSClient.java34
1 files changed, 25 insertions, 9 deletions
diff --git a/src/main/java/at/gv/util/client/mzs/MOAZSClient.java b/src/main/java/at/gv/util/client/mzs/MOAZSClient.java
index dc66a2b..f696b6d 100644
--- a/src/main/java/at/gv/util/client/mzs/MOAZSClient.java
+++ b/src/main/java/at/gv/util/client/mzs/MOAZSClient.java
@@ -12,6 +12,11 @@ import javax.xml.ws.BindingProvider;
import javax.xml.ws.WebServiceContext;
import javax.xml.ws.handler.Handler;
+import org.apache.cxf.configuration.jsse.TLSClientParameters;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.transport.http.HTTPConduit;
+import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -24,8 +29,6 @@ import at.gv.util.wsdl.mzs.App2MzsPortType;
import at.gv.util.xsd.mzs.DeliveryRequestType;
import at.gv.util.xsd.mzs.DeliveryResponseType;
-import com.sun.xml.ws.developer.JAXWSProperties;
-
public class MOAZSClient {
@Resource
@@ -85,13 +88,26 @@ public class MOAZSClient {
if (sslContext == null) {
throw new MOAZSClientException("SSL context from configuration is empty. Please configure an SSL context in the configuration first.");
}
- requestContext.put(JAXWSProperties.SSL_SOCKET_FACTORY, sslContext.getSocketFactory());
-
- // check for lax hostname
- if (this.config.getMOAIDsslConfiguration().useLaxHostNameVerifier()) {
- log.trace("LaxHostnameVerifier enabled. This setting is not recommended to use.");
- requestContext.put(JAXWSProperties.HOSTNAME_VERIFIER, new LaxHostNameVerifier());
- }
+ Client client = ClientProxy.getClient(port);
+ HTTPConduit http = (HTTPConduit) client.getConduit();
+ HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
+
+ httpClientPolicy.setConnectionTimeout(36000);
+ httpClientPolicy.setAllowChunking(false);
+ httpClientPolicy.setReceiveTimeout(32000);
+
+ http.setClient(httpClientPolicy);
+
+ TLSClientParameters tlsParams = new TLSClientParameters();
+ tlsParams.setSSLSocketFactory(sslContext.getSocketFactory());
+
+ // check for lax hostname
+ if (this.config.getMOAIDsslConfiguration().useLaxHostNameVerifier()) {
+ log.trace("LaxHostnameVerifier enabled. This setting is not recommended to use.");
+ tlsParams.setHostnameVerifier(new LaxHostNameVerifier());
+ }
+
+ http.setTlsClientParameters(tlsParams );
}
// make simple moa-id request