forked from anaisbetts/ModernHttpClient
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated OKHttp libraries Remove validation of client certificates for class HostnameVerifier - OkHttpNetworkHandler
- Loading branch information
1 parent
64b36bb
commit e1db38a
Showing
5 changed files
with
111 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
using Javax.Net.Ssl; | ||
|
||
namespace ModernHttpClient | ||
{ | ||
|
||
public class TlsSSLSocketFactory : SSLSocketFactory | ||
{ | ||
readonly SSLSocketFactory factory = (SSLSocketFactory)Default; | ||
|
||
public override string [] GetDefaultCipherSuites () | ||
{ | ||
return factory.GetDefaultCipherSuites (); | ||
} | ||
|
||
public override string [] GetSupportedCipherSuites () | ||
{ | ||
return factory.GetSupportedCipherSuites (); | ||
} | ||
public override Java.Net.Socket CreateSocket (Java.Net.InetAddress address, int port, Java.Net.InetAddress localAddress, int localPort) | ||
{ | ||
SSLSocket socket = (SSLSocket)factory.CreateSocket (address, port, localAddress, localPort); | ||
socket.SetEnabledProtocols (socket.GetSupportedProtocols ()); | ||
socket.SetEnabledCipherSuites (socket.GetSupportedCipherSuites ()); | ||
|
||
return socket; | ||
} | ||
|
||
public override Java.Net.Socket CreateSocket (Java.Net.InetAddress host, int port) | ||
{ | ||
SSLSocket socket = (SSLSocket)factory.CreateSocket (host, port); | ||
socket.SetEnabledProtocols (socket.GetSupportedProtocols ()); | ||
socket.SetEnabledCipherSuites (socket.GetSupportedCipherSuites ()); | ||
|
||
return socket; | ||
} | ||
|
||
public override Java.Net.Socket CreateSocket (string host, int port, Java.Net.InetAddress localHost, int localPort) | ||
{ | ||
SSLSocket socket = (SSLSocket)factory.CreateSocket (host, port, localHost, localPort); | ||
socket.SetEnabledProtocols (socket.GetSupportedProtocols ()); | ||
socket.SetEnabledCipherSuites (socket.GetSupportedCipherSuites ()); | ||
|
||
return socket; | ||
} | ||
|
||
public override Java.Net.Socket CreateSocket (string host, int port) | ||
{ | ||
SSLSocket socket = (SSLSocket)factory.CreateSocket (host, port); | ||
socket.SetEnabledProtocols (socket.GetSupportedProtocols ()); | ||
socket.SetEnabledCipherSuites (socket.GetSupportedCipherSuites ()); | ||
|
||
return socket; | ||
} | ||
|
||
public override Java.Net.Socket CreateSocket (Java.Net.Socket s, string host, int port, bool autoClose) | ||
{ | ||
SSLSocket socket = (SSLSocket)factory.CreateSocket (s, host, port, autoClose); | ||
socket.SetEnabledProtocols (socket.GetSupportedProtocols ()); | ||
socket.SetEnabledCipherSuites (socket.GetSupportedCipherSuites ()); | ||
|
||
return socket; | ||
} | ||
|
||
protected override void Dispose (bool disposing) | ||
{ | ||
factory.Dispose (); | ||
base.Dispose (disposing); | ||
} | ||
|
||
public override Java.Net.Socket CreateSocket () | ||
{ | ||
SSLSocket socket = (SSLSocket)factory.CreateSocket (); | ||
socket.SetEnabledProtocols (socket.GetSupportedProtocols ()); | ||
socket.SetEnabledCipherSuites (socket.GetSupportedCipherSuites ()); | ||
|
||
return socket; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Square.OkHttp" version="2.4.0.3" targetFramework="MonoAndroid23" /> | ||
<package id="Square.OkIO" version="1.5.0.0" targetFramework="MonoAndroid23" /> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Square.OkHttp" version="2.7.5.0" targetFramework="monoandroid23" /> | ||
<package id="Square.OkIO" version="1.11.0" targetFramework="monoandroid23" /> | ||
</packages> |