For Jersey 2.*:
Client client = ClientBuilder.newBuilder()
.hostnameVerifier(new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
}).build();
-> https://jersey.java.net/documentation/latest/migration.html