Reverse order of conditions in if clause

This commit is contained in:
cketti 2015-09-15 21:32:08 +02:00
parent 732463a89f
commit c0924c2031

View file

@ -182,8 +182,8 @@ public class DefaultTrustedSocketFactory implements TrustedSocketFactory {
}
public static void setSniHost(SSLSocketFactory factory, SSLSocket socket, String hostname) {
if (factory instanceof android.net.SSLCertificateSocketFactory &&
android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1 &&
factory instanceof android.net.SSLCertificateSocketFactory) {
SSLCertificateSocketFactory sslCertificateSocketFactory = (SSLCertificateSocketFactory) factory;
sslCertificateSocketFactory.setHostname(socket, hostname);
} else {