Android.Net.SSLCertificateSocketFactory Class
SSLSocketFactory implementation with several extra features: The handshake timeout does not apply to actual TCP socket connection.

See Also: SSLCertificateSocketFactory Members

Syntax

[Android.Runtime.Register("android/net/SSLCertificateSocketFactory", DoNotGenerateAcw=true)]
public class SSLCertificateSocketFactory : Javax.Net.Ssl.SSLSocketFactory

Remarks

SSLSocketFactory implementation with several extra features:

The handshake timeout does not apply to actual TCP socket connection. If you want a connection timeout as well, use SSLCertificateSocketFactory.createSocket() and Java.Net.Socket.Connect(Java.Net.SocketAddress, System.Int32), after which you must verify the identity of the server you are connected to.

Most Javax.Net.Ssl.SSLSocketFactory implementations do not verify the server's identity, allowing man-in-the-middle attacks. This implementation does check the server's certificate hostname, but only for createSocket variants that specify a hostname. When using methods that use Java.Net.InetAddress or which return an unconnected socket, you MUST verify the server's identity yourself to ensure a secure connection.

One way to verify the server's identity is to use Javax.Net.Ssl.HttpsURLConnection.DefaultHostnameVerifier to get a Javax.Net.Ssl.IHostnameVerifier to verify the certificate hostname.

On development devices, "setprop socket.relaxsslcheck yes" bypasses all SSL certificate and hostname checks for testing purposes. This setting requires root access.

[Android Documentation]

Requirements

Namespace: Android.Net
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1