Merge pull request #922 from charithag/master

Fixed incorrect port issue when default ssl port is used
revert-dabc3590
Geeth 6 years ago committed by GitHub
commit 667027f62b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

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

Loading…
Cancel
Save