// Create a collection object and populate it using the PFX file
var collection = new X509Certificate2Collection();
collection.Import(@"C:\client.pfx", "PASSWORD", X509KeyStorageFlags.PersistKeySet);
// prep SSLOptions
var options = new SSLOptions();
// assign certs
options.SetCertificateCollection(collection);
// skip validation of remote cert (SSL)
options.SetRemoteCertValidationCallback((a1, a2, a3, a4) => true);
var cluster = Cluster.Builder()
.AddContactPoint(contactPoint)
.WithCredentials(user, pass)
.WithSSL(options)
.Build();
try {
var session = cluster.Connect();
} catch (Exception ex) {
Debug.WriteLine(ex.ToString());
throw;
}
--
You received this message because you are subscribed to the Google Groups "DataStax C# Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to csharp-driver-user+unsub...@lists.datastax.com.
//custom host resolver to resolve server ip to certificate CNoptions.SetHostNameResolver((internalIPAddress) => { return "my-hostname"; // my hostname is also used as alias and as CN name in keytool so it matches 100% });options.SetRemoteCertValidationCallback(handler);
To unsubscribe from this group and stop receiving emails from it, send an email to csharp-driver-user+unsubscribe@lists.datastax.com.
To unsubscribe from this group and stop receiving emails from it, send an email to csharp-driver-user+unsub...@lists.datastax.com.