Fixed incorrect port issue when default ssl port is used

This commit is contained in:
charitha 2018-10-24 20:10:31 +05:30
parent e2424266eb
commit 1347be2cea
2 changed files with 12 additions and 4 deletions

View File

@ -116,8 +116,12 @@ public class OAuthTokenValidaterStubFactory extends BasePoolableObjectFactory {
if (hostURL.getProtocol().equals("https")) {
// set up ssl factory since axis2 https transport is used.
EasySSLProtocolSocketFactory sslProtocolSocketFactory = createProtocolSocketFactory();
Protocol authhttps = new Protocol(hostURL.getProtocol()
, (ProtocolSocketFactory) sslProtocolSocketFactory, hostURL.getPort());
int port = hostURL.getPort();
if (port == -1) {
port = 443;
}
Protocol authhttps = new Protocol(hostURL.getProtocol(),
(ProtocolSocketFactory) sslProtocolSocketFactory, port);
Protocol.registerProtocol(hostURL.getProtocol(), authhttps);
options.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER, authhttps);
}

View File

@ -116,8 +116,12 @@ public class OAuthTokenValidatorStubFactory extends BasePoolableObjectFactory {
if (hostURL.getProtocol().equals("https")) {
// set up ssl factory since axis2 https notification is used.
EasySSLProtocolSocketFactory sslProtocolSocketFactory = createProtocolSocketFactory();
Protocol authhttps = new Protocol(hostURL.getProtocol()
, (ProtocolSocketFactory) sslProtocolSocketFactory, hostURL.getPort());
int port = hostURL.getPort();
if (port == -1) {
port = 443;
}
Protocol authhttps = new Protocol(hostURL.getProtocol(),
(ProtocolSocketFactory) sslProtocolSocketFactory, port);
Protocol.registerProtocol(hostURL.getProtocol(), authhttps);
options.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER, authhttps);
}