diff --git a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/internal/APIManagerComponent.java b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/internal/APIManagerComponent.java index 9b9b0d01fe55..d43fc8a39596 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/internal/APIManagerComponent.java +++ b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/internal/APIManagerComponent.java @@ -22,6 +22,7 @@ import org.apache.commons.logging.LogFactory; import org.apache.http.conn.ssl.DefaultHostnameVerifier; import org.apache.http.conn.ssl.NoopHostnameVerifier; +import org.apache.http.conn.ssl.SSLSocketFactory; import org.apache.http.ssl.SSLContexts; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceRegistration; @@ -1059,7 +1060,8 @@ void populateHttpClientConfiguration() { final String[] localhosts = { "::1", "127.0.0.1", "localhost", "localhost.localdomain" }; @Override public boolean verify(String urlHostName, SSLSession session) { - return Arrays.asList(localhosts).contains(urlHostName); + return SSLSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER.verify(urlHostName, session) + || Arrays.asList(localhosts).contains(urlHostName); } }; break;