org.dstadler.commons.net.AllowingHostnameVerifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons-dost Show documentation
Show all versions of commons-dost Show documentation
Common utilities I find useful in many of my projects.
package org.dstadler.commons.net;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLSession;
/**
* Allows to connect to HTTPS urls without verifying the host mentioned in the SSL certificate.
*
* @author dominik.stadler
*/
public final class AllowingHostnameVerifier implements HostnameVerifier {
private static HostnameVerifier INSTANCE = new AllowingHostnameVerifier();
public static HostnameVerifier instance() {
return INSTANCE;
}
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy