mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-15 12:12:31 +08:00
Adding TLSv1 support for custom SSL socket factory
Summary: This problem tries to solve issue #14244 Implemented a fetch request to a TLSv1 server. It now successfully resolves TLS handshake. Tested same fetch to TLSv1.2 server and still successfully resolves TLS handshake. Closes https://github.com/facebook/react-native/pull/14245 Differential Revision: D5898689 Pulled By: shergin fbshipit-source-id: 8766ebe6909443367651ab868aa5ff62747cd906
This commit is contained in:
committed by
Facebook Github Bot
parent
9bf936ccba
commit
0818f3bdf5
@@ -71,7 +71,7 @@ public class TLSSocketFactory extends SSLSocketFactory {
|
||||
|
||||
private Socket enableTLSOnSocket(Socket socket) {
|
||||
if(socket != null && (socket instanceof SSLSocket)) {
|
||||
((SSLSocket)socket).setEnabledProtocols(new String[] {"TLSv1.1", "TLSv1.2"});
|
||||
((SSLSocket)socket).setEnabledProtocols(new String[] {"TLSv1", "TLSv1.1", "TLSv1.2"});
|
||||
}
|
||||
return socket;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user