mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2025-02-17 04:00:48 +01:00
fixed lint error
This commit is contained in:
parent
5828cd9063
commit
4f027b4af7
@ -20,7 +20,6 @@
|
|||||||
package org.mariotaku.twidere.util.net;
|
package org.mariotaku.twidere.util.net;
|
||||||
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.support.annotation.RequiresApi;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
@ -35,7 +34,6 @@ import javax.net.ssl.SSLSocketFactory;
|
|||||||
/**
|
/**
|
||||||
* @author fkrauthan
|
* @author fkrauthan
|
||||||
*/
|
*/
|
||||||
@RequiresApi(Build.VERSION_CODES.JELLY_BEAN)
|
|
||||||
public class TLSSocketFactory extends SSLSocketFactory {
|
public class TLSSocketFactory extends SSLSocketFactory {
|
||||||
|
|
||||||
private SSLSocketFactory internalSSLSocketFactory;
|
private SSLSocketFactory internalSSLSocketFactory;
|
||||||
@ -87,9 +85,11 @@ public class TLSSocketFactory extends SSLSocketFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Socket enableTLSOnSocket(Socket socket) {
|
private Socket enableTLSOnSocket(Socket socket) {
|
||||||
if(socket != null && (socket instanceof SSLSocket)) {
|
if (socket == null || (!(socket instanceof SSLSocket))) {
|
||||||
((SSLSocket)socket).setEnabledProtocols(new String[] {"TLSv1.1", "TLSv1.2"});
|
return socket;
|
||||||
}
|
}
|
||||||
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) return socket;
|
||||||
|
((SSLSocket) socket).setEnabledProtocols(new String[]{"TLSv1.1", "TLSv1.2"});
|
||||||
return socket;
|
return socket;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user