Disable host name verification for favicons

This commit is contained in:
M66B 2020-12-11 08:32:11 +01:00
parent 31f4985bee
commit b206e9d9ce
1 changed files with 14 additions and 0 deletions

View File

@ -71,11 +71,13 @@ import java.util.concurrent.Future;
import javax.mail.Address;
import javax.mail.internet.InternetAddress;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLHandshakeException;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLProtocolException;
import javax.net.ssl.SSLSession;
public class ContactInfo {
private String email;
@ -462,6 +464,12 @@ public class ContactInfo {
connection.setReadTimeout(FAVICON_READ_TIMEOUT);
connection.setConnectTimeout(FAVICON_CONNECT_TIMEOUT);
connection.setInstanceFollowRedirects(true);
connection.setHostnameVerifier(new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
});
connection.connect();
String response;
@ -537,6 +545,12 @@ public class ContactInfo {
connection.setReadTimeout(FAVICON_READ_TIMEOUT);
connection.setConnectTimeout(FAVICON_CONNECT_TIMEOUT);
connection.setInstanceFollowRedirects(true);
connection.setHostnameVerifier(new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
});
connection.connect();
try {