mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-31 02:17:41 +00:00 
			
		
		
		
	TLSv1.1 and TLSv1.2 fix
This commit is contained in:
		
							parent
							
								
									5bd0d73877
								
							
						
					
					
						commit
						539ea8f71a
					
				| @ -86,6 +86,7 @@ public class AdvancedSslSocketFactory implements ProtocolSocketFactory { | ||||
|      */ | ||||
|     public Socket createSocket(String host, int port, InetAddress clientHost, int clientPort) throws IOException, UnknownHostException { | ||||
|         Socket socket = mSslContext.getSocketFactory().createSocket(host, port, clientHost, clientPort); | ||||
|         ((SSLSocket) socket).setEnabledProtocols(new String[]{"TLSv1", "TLSv1.1", "TLSv1.2"}); | ||||
|         verifyPeerIdentity(host, port, socket); | ||||
|         return socket; | ||||
|     } | ||||
| @ -161,6 +162,7 @@ public class AdvancedSslSocketFactory implements ProtocolSocketFactory { | ||||
|         SocketFactory socketfactory = mSslContext.getSocketFactory(); | ||||
|         Log_OC.d(TAG, " ... with connection timeout " + timeout + " and socket timeout " + params.getSoTimeout()); | ||||
|         Socket socket = socketfactory.createSocket(); | ||||
|         ((SSLSocket) socket).setEnabledProtocols(new String[]{"TLSv1", "TLSv1.1", "TLSv1.2"}); | ||||
|         SocketAddress localaddr = new InetSocketAddress(localAddress, localPort); | ||||
|         SocketAddress remoteaddr = new InetSocketAddress(host, port); | ||||
|         socket.setSoTimeout(params.getSoTimeout()); | ||||
| @ -178,6 +180,7 @@ public class AdvancedSslSocketFactory implements ProtocolSocketFactory { | ||||
|             UnknownHostException { | ||||
|     	Log_OC.d(TAG, "Creating SSL Socket with remote " + host + ":" + port); | ||||
|         Socket socket = mSslContext.getSocketFactory().createSocket(host, port); | ||||
|         ((SSLSocket) socket).setEnabledProtocols(new String[]{"TLSv1", "TLSv1.1", "TLSv1.2"}); | ||||
|         verifyPeerIdentity(host, port, socket); | ||||
|         return socket;  | ||||
|     } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user