diff options
Diffstat (limited to 'src/main/java/at/gv/util/client/szr')
-rw-r--r-- | src/main/java/at/gv/util/client/szr/SZRClient.java | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/src/main/java/at/gv/util/client/szr/SZRClient.java b/src/main/java/at/gv/util/client/szr/SZRClient.java index 97e3d12..956cebc 100644 --- a/src/main/java/at/gv/util/client/szr/SZRClient.java +++ b/src/main/java/at/gv/util/client/szr/SZRClient.java @@ -13,6 +13,11 @@ import javax.xml.ws.Holder; 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; @@ -31,8 +36,6 @@ import at.gv.util.xsd.szr.PersonInfoType; import at.gv.util.xsd.szr.pvp.PvpTokenType; import at.gv.util.xsd.szr.xmldsig.KeyValueType; -import com.sun.xml.ws.developer.JAXWSProperties; - public class SZRClient { @Resource @@ -158,14 +161,28 @@ public class SZRClient { SSLContext sslContext = this.config.getSZRsslConfiguration().getSSLContext(false); if (sslContext == null) { throw new EgovUtilException("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.getSZRsslConfiguration().useLaxHostNameVerifier()) { - log.trace("LaxHostnameVerifier enabled. This setting is not recommended to use."); - requestContext.put(JAXWSProperties.HOSTNAME_VERIFIER, new LaxHostNameVerifier()); - } + + } + + Client client = ClientProxy.getClient(szr); + HTTPConduit http = (HTTPConduit) client.getConduit(); + HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); + + httpClientPolicy.setConnectionTimeout(36000); + httpClientPolicy.setReceiveTimeout(32000); + + http.setClient(httpClientPolicy); + + TLSClientParameters tlsParams = new TLSClientParameters(); + tlsParams.setSSLSocketFactory(sslContext.getSocketFactory()); + + // check for lax hostname + if (this.config.getSZRsslConfiguration().useLaxHostNameVerifier()) { + log.trace("LaxHostnameVerifier enabled. This setting is not recommended to use."); + tlsParams.setHostnameVerifier(new LaxHostNameVerifier()); + } + + http.setTlsClientParameters(tlsParams ); } } |