using System.Net.Security; using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; namespace RethinkDb.Driver.Net { /// /// Settings object for SSL/TLS connections with RethinkDB. /// public class SslContext { /// /// Client certificates. /// public X509CertificateCollection ClientCertificateCollection { get; set; } = new X509Certificate2Collection(); /// /// Server-side certificate validation callback. /// public RemoteCertificateValidationCallback ServerCertificateValidationCallback { get; set; } /// /// Client-side certificate validation callback /// public LocalCertificateSelectionCallback LocalCertificateSelectionCallback { get; set; } /// /// The enabled security protocols to use over the socket. Default: TLS, TLS 1.1, TLS 1.2. /// SSLv2 and SSLv3 are considered insecure. /// public SslProtocols EnabledProtocols { get; set; } = SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12; /// /// By default, the connection's hostname is used. This setting can override host verification. /// public string TargetHostOverride { get; set; } /// /// Check for certificate revocation. /// public bool CheckCertificateRevocation { get; set; } = false; } }