How to configure SSL and HTTP Proxy with Axis2 using httpClient4
i want to use axis2 1.7.8 to connect via https (443 port) through http proxy (port 8080) to webservice.
I read article https://stackoverflow.com/a/53171162/1692626 which describe how to configure httpclient 4 and SSL.
I tried to set proxy as options with HttpTransportProperties.ProxyProperties with no luck. I tried also set proxy as Httphost directly to httpclient (httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,proxy) and register additional http port 8080 but I got exceptions like "Unrecognized SSL message, plaintext connection?"
What is the proper way to do it ?
Here is my code with last interation
public static <Axis2Stub extends Stub> void initHttpsStub(Axis2Stub stub, String proxyIp, Integer proxyPort, long connectionTimeout, long connectionRequestTimeout, long socketTimeout, String trustStore, String trustStorePass){
if(stub != null){
stub._getServiceClient().getOptions().setProperty(HTTPConstants.CACHED_HTTP_CLIENT,
getHttpClient(proxyIp, proxyPort, trustStore, trustStorePass, connectionTimeout, connectionRequestTimeout, socketTimeout));
}
}
private static HttpClient getHttpClient(String proxyIp, Integer proxyPort, String trustStorePath, String trustStorePass, long connectionTimeout, long connectionRequestTimeout, long socketTimeout){
try {
KeyStore keyStore = KeyStore.getInstance("JKS");
LOG.debug("Loading keystore file:{}", trustStorePath);
keyStore.load(new FileInputStream(new File(trustStorePath)), trustStorePass.toCharArray());
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
keyManagerFactory.init(keyStore, trustStorePass.toCharArray());
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
trustManagerFactory.init(keyStore);
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), new SecureRandom());
SSLSocketFactory sf = new SSLSocketFactory(sslContext);
SchemeRegistry schemeRegistry = new SchemeRegistry();
if(proxyPort != null) {
Scheme httpScheme = new Scheme("http", proxyPort, sf);
schemeRegistry.register(httpScheme);
}
Scheme httpsScheme = new Scheme("https", 443, sf);
schemeRegistry.register(httpsScheme);
ClientConnectionManager cm = new PoolingClientConnectionManager(schemeRegistry);
HttpClient httpClient = new DefaultHttpClient(cm);
HttpParams params = httpClient.getParams();
params.setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, connectionTimeout);
params.setParameter(CoreConnectionPNames.SO_TIMEOUT, socketTimeout);
params.setParameter(ClientPNames.CONN_MANAGER_TIMEOUT, connectionRequestTimeout);
if(proxyIp != null && proxyPort != null){
HttpHost proxy = new HttpHost(proxyIp, proxyPort);
params.setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
}
return httpClient;
}catch (GeneralSecurityException | IOException ex){
throw new MwRuntimeException(ex, "1", "Unable to initialize webservice client: " + ex.getMessage());
}
}
And a stacktrace
2018-11-22 09:18:46,023 INFO [org.apache.axis2.transport.http.impl.httpclient4.HTTPSenderImpl] (default task-1) [b4a5d3ca-318d-4869-84ff-a2f7aa71ea81] Unable to sendViaPost to url[https://XXXXXXXXXXXXXXXXXXX]: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at sun.security.ssl.InputRecord.handleUnknownRecord(InputRecord.java:710)
at sun.security.ssl.InputRecord.read(InputRecord.java:527)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
at org.apache.http.conn.ssl.SSLSocketFactory.createLayeredSocket(SSLSocketFactory.java:573)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:557)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:414)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:326)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at org.apache.axis2.transport.http.impl.httpclient4.HTTPSenderImpl.executeMethod(HTTPSenderImpl.java:873)
at org.apache.axis2.transport.http.impl.httpclient4.HTTPSenderImpl.sendViaPost(HTTPSenderImpl.java:238)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:121)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:403)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:234)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:431)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:399)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:150)
at xxxxx.Stub.getID(Stub.java:173)
I tried to remove http port register but then i got exception that http configuration is missing.
The application works on server wildfly12. I know i can use cxf but i cannot change it
ssl axis2 apache-httpclient-4.x
add a comment |
i want to use axis2 1.7.8 to connect via https (443 port) through http proxy (port 8080) to webservice.
I read article https://stackoverflow.com/a/53171162/1692626 which describe how to configure httpclient 4 and SSL.
I tried to set proxy as options with HttpTransportProperties.ProxyProperties with no luck. I tried also set proxy as Httphost directly to httpclient (httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,proxy) and register additional http port 8080 but I got exceptions like "Unrecognized SSL message, plaintext connection?"
What is the proper way to do it ?
Here is my code with last interation
public static <Axis2Stub extends Stub> void initHttpsStub(Axis2Stub stub, String proxyIp, Integer proxyPort, long connectionTimeout, long connectionRequestTimeout, long socketTimeout, String trustStore, String trustStorePass){
if(stub != null){
stub._getServiceClient().getOptions().setProperty(HTTPConstants.CACHED_HTTP_CLIENT,
getHttpClient(proxyIp, proxyPort, trustStore, trustStorePass, connectionTimeout, connectionRequestTimeout, socketTimeout));
}
}
private static HttpClient getHttpClient(String proxyIp, Integer proxyPort, String trustStorePath, String trustStorePass, long connectionTimeout, long connectionRequestTimeout, long socketTimeout){
try {
KeyStore keyStore = KeyStore.getInstance("JKS");
LOG.debug("Loading keystore file:{}", trustStorePath);
keyStore.load(new FileInputStream(new File(trustStorePath)), trustStorePass.toCharArray());
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
keyManagerFactory.init(keyStore, trustStorePass.toCharArray());
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
trustManagerFactory.init(keyStore);
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), new SecureRandom());
SSLSocketFactory sf = new SSLSocketFactory(sslContext);
SchemeRegistry schemeRegistry = new SchemeRegistry();
if(proxyPort != null) {
Scheme httpScheme = new Scheme("http", proxyPort, sf);
schemeRegistry.register(httpScheme);
}
Scheme httpsScheme = new Scheme("https", 443, sf);
schemeRegistry.register(httpsScheme);
ClientConnectionManager cm = new PoolingClientConnectionManager(schemeRegistry);
HttpClient httpClient = new DefaultHttpClient(cm);
HttpParams params = httpClient.getParams();
params.setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, connectionTimeout);
params.setParameter(CoreConnectionPNames.SO_TIMEOUT, socketTimeout);
params.setParameter(ClientPNames.CONN_MANAGER_TIMEOUT, connectionRequestTimeout);
if(proxyIp != null && proxyPort != null){
HttpHost proxy = new HttpHost(proxyIp, proxyPort);
params.setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
}
return httpClient;
}catch (GeneralSecurityException | IOException ex){
throw new MwRuntimeException(ex, "1", "Unable to initialize webservice client: " + ex.getMessage());
}
}
And a stacktrace
2018-11-22 09:18:46,023 INFO [org.apache.axis2.transport.http.impl.httpclient4.HTTPSenderImpl] (default task-1) [b4a5d3ca-318d-4869-84ff-a2f7aa71ea81] Unable to sendViaPost to url[https://XXXXXXXXXXXXXXXXXXX]: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at sun.security.ssl.InputRecord.handleUnknownRecord(InputRecord.java:710)
at sun.security.ssl.InputRecord.read(InputRecord.java:527)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
at org.apache.http.conn.ssl.SSLSocketFactory.createLayeredSocket(SSLSocketFactory.java:573)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:557)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:414)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:326)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at org.apache.axis2.transport.http.impl.httpclient4.HTTPSenderImpl.executeMethod(HTTPSenderImpl.java:873)
at org.apache.axis2.transport.http.impl.httpclient4.HTTPSenderImpl.sendViaPost(HTTPSenderImpl.java:238)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:121)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:403)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:234)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:431)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:399)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:150)
at xxxxx.Stub.getID(Stub.java:173)
I tried to remove http port register but then i got exception that http configuration is missing.
The application works on server wildfly12. I know i can use cxf but i cannot change it
ssl axis2 apache-httpclient-4.x
add a comment |
i want to use axis2 1.7.8 to connect via https (443 port) through http proxy (port 8080) to webservice.
I read article https://stackoverflow.com/a/53171162/1692626 which describe how to configure httpclient 4 and SSL.
I tried to set proxy as options with HttpTransportProperties.ProxyProperties with no luck. I tried also set proxy as Httphost directly to httpclient (httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,proxy) and register additional http port 8080 but I got exceptions like "Unrecognized SSL message, plaintext connection?"
What is the proper way to do it ?
Here is my code with last interation
public static <Axis2Stub extends Stub> void initHttpsStub(Axis2Stub stub, String proxyIp, Integer proxyPort, long connectionTimeout, long connectionRequestTimeout, long socketTimeout, String trustStore, String trustStorePass){
if(stub != null){
stub._getServiceClient().getOptions().setProperty(HTTPConstants.CACHED_HTTP_CLIENT,
getHttpClient(proxyIp, proxyPort, trustStore, trustStorePass, connectionTimeout, connectionRequestTimeout, socketTimeout));
}
}
private static HttpClient getHttpClient(String proxyIp, Integer proxyPort, String trustStorePath, String trustStorePass, long connectionTimeout, long connectionRequestTimeout, long socketTimeout){
try {
KeyStore keyStore = KeyStore.getInstance("JKS");
LOG.debug("Loading keystore file:{}", trustStorePath);
keyStore.load(new FileInputStream(new File(trustStorePath)), trustStorePass.toCharArray());
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
keyManagerFactory.init(keyStore, trustStorePass.toCharArray());
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
trustManagerFactory.init(keyStore);
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), new SecureRandom());
SSLSocketFactory sf = new SSLSocketFactory(sslContext);
SchemeRegistry schemeRegistry = new SchemeRegistry();
if(proxyPort != null) {
Scheme httpScheme = new Scheme("http", proxyPort, sf);
schemeRegistry.register(httpScheme);
}
Scheme httpsScheme = new Scheme("https", 443, sf);
schemeRegistry.register(httpsScheme);
ClientConnectionManager cm = new PoolingClientConnectionManager(schemeRegistry);
HttpClient httpClient = new DefaultHttpClient(cm);
HttpParams params = httpClient.getParams();
params.setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, connectionTimeout);
params.setParameter(CoreConnectionPNames.SO_TIMEOUT, socketTimeout);
params.setParameter(ClientPNames.CONN_MANAGER_TIMEOUT, connectionRequestTimeout);
if(proxyIp != null && proxyPort != null){
HttpHost proxy = new HttpHost(proxyIp, proxyPort);
params.setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
}
return httpClient;
}catch (GeneralSecurityException | IOException ex){
throw new MwRuntimeException(ex, "1", "Unable to initialize webservice client: " + ex.getMessage());
}
}
And a stacktrace
2018-11-22 09:18:46,023 INFO [org.apache.axis2.transport.http.impl.httpclient4.HTTPSenderImpl] (default task-1) [b4a5d3ca-318d-4869-84ff-a2f7aa71ea81] Unable to sendViaPost to url[https://XXXXXXXXXXXXXXXXXXX]: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at sun.security.ssl.InputRecord.handleUnknownRecord(InputRecord.java:710)
at sun.security.ssl.InputRecord.read(InputRecord.java:527)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
at org.apache.http.conn.ssl.SSLSocketFactory.createLayeredSocket(SSLSocketFactory.java:573)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:557)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:414)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:326)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at org.apache.axis2.transport.http.impl.httpclient4.HTTPSenderImpl.executeMethod(HTTPSenderImpl.java:873)
at org.apache.axis2.transport.http.impl.httpclient4.HTTPSenderImpl.sendViaPost(HTTPSenderImpl.java:238)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:121)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:403)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:234)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:431)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:399)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:150)
at xxxxx.Stub.getID(Stub.java:173)
I tried to remove http port register but then i got exception that http configuration is missing.
The application works on server wildfly12. I know i can use cxf but i cannot change it
ssl axis2 apache-httpclient-4.x
i want to use axis2 1.7.8 to connect via https (443 port) through http proxy (port 8080) to webservice.
I read article https://stackoverflow.com/a/53171162/1692626 which describe how to configure httpclient 4 and SSL.
I tried to set proxy as options with HttpTransportProperties.ProxyProperties with no luck. I tried also set proxy as Httphost directly to httpclient (httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,proxy) and register additional http port 8080 but I got exceptions like "Unrecognized SSL message, plaintext connection?"
What is the proper way to do it ?
Here is my code with last interation
public static <Axis2Stub extends Stub> void initHttpsStub(Axis2Stub stub, String proxyIp, Integer proxyPort, long connectionTimeout, long connectionRequestTimeout, long socketTimeout, String trustStore, String trustStorePass){
if(stub != null){
stub._getServiceClient().getOptions().setProperty(HTTPConstants.CACHED_HTTP_CLIENT,
getHttpClient(proxyIp, proxyPort, trustStore, trustStorePass, connectionTimeout, connectionRequestTimeout, socketTimeout));
}
}
private static HttpClient getHttpClient(String proxyIp, Integer proxyPort, String trustStorePath, String trustStorePass, long connectionTimeout, long connectionRequestTimeout, long socketTimeout){
try {
KeyStore keyStore = KeyStore.getInstance("JKS");
LOG.debug("Loading keystore file:{}", trustStorePath);
keyStore.load(new FileInputStream(new File(trustStorePath)), trustStorePass.toCharArray());
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
keyManagerFactory.init(keyStore, trustStorePass.toCharArray());
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
trustManagerFactory.init(keyStore);
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), new SecureRandom());
SSLSocketFactory sf = new SSLSocketFactory(sslContext);
SchemeRegistry schemeRegistry = new SchemeRegistry();
if(proxyPort != null) {
Scheme httpScheme = new Scheme("http", proxyPort, sf);
schemeRegistry.register(httpScheme);
}
Scheme httpsScheme = new Scheme("https", 443, sf);
schemeRegistry.register(httpsScheme);
ClientConnectionManager cm = new PoolingClientConnectionManager(schemeRegistry);
HttpClient httpClient = new DefaultHttpClient(cm);
HttpParams params = httpClient.getParams();
params.setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, connectionTimeout);
params.setParameter(CoreConnectionPNames.SO_TIMEOUT, socketTimeout);
params.setParameter(ClientPNames.CONN_MANAGER_TIMEOUT, connectionRequestTimeout);
if(proxyIp != null && proxyPort != null){
HttpHost proxy = new HttpHost(proxyIp, proxyPort);
params.setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
}
return httpClient;
}catch (GeneralSecurityException | IOException ex){
throw new MwRuntimeException(ex, "1", "Unable to initialize webservice client: " + ex.getMessage());
}
}
And a stacktrace
2018-11-22 09:18:46,023 INFO [org.apache.axis2.transport.http.impl.httpclient4.HTTPSenderImpl] (default task-1) [b4a5d3ca-318d-4869-84ff-a2f7aa71ea81] Unable to sendViaPost to url[https://XXXXXXXXXXXXXXXXXXX]: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at sun.security.ssl.InputRecord.handleUnknownRecord(InputRecord.java:710)
at sun.security.ssl.InputRecord.read(InputRecord.java:527)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
at org.apache.http.conn.ssl.SSLSocketFactory.createLayeredSocket(SSLSocketFactory.java:573)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:557)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:414)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:326)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at org.apache.axis2.transport.http.impl.httpclient4.HTTPSenderImpl.executeMethod(HTTPSenderImpl.java:873)
at org.apache.axis2.transport.http.impl.httpclient4.HTTPSenderImpl.sendViaPost(HTTPSenderImpl.java:238)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:121)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:403)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:234)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:431)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:399)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:150)
at xxxxx.Stub.getID(Stub.java:173)
I tried to remove http port register but then i got exception that http configuration is missing.
The application works on server wildfly12. I know i can use cxf but i cannot change it
ssl axis2 apache-httpclient-4.x
ssl axis2 apache-httpclient-4.x
asked Nov 23 '18 at 7:42
EzrielEzriel
135
135
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53442500%2fhow-to-configure-ssl-and-http-proxy-with-axis2-using-httpclient4%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53442500%2fhow-to-configure-ssl-and-http-proxy-with-axis2-using-httpclient4%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown