我使用c#cassandra驱动程序尝试通过控制台应用程序连接到aws cassandra服务(Cassandra司机:https://github.com/datastax/csharp-driver)我还下载了amazonrootca1.pem并将其导入根文件夹
但每次我尝试连接时,都会因为ssl而失败:
Cluster cluster = Cluster.Builder()
.AddContactPoint("cassandra.us-east-2.amazonaws.com")
.WithPort(9142)
.WithAuthProvider(new PlainTextAuthProvider("LoginName", "Password"))
.WithSSL()
.Build();
var session = cluster.Connect("tutorialkeyspace");
var rs = session.Execute("SELECT * FROM tutorialtable");
foreach (var row in rs)
{
var value = row.GetValue<int>("sample_int_column");
Console.WriteLine("Success");
}
有人能帮我一下我做错了什么吗?
非常感谢你。
1条答案
按热度按时间a9wyjsp71#
试试下面的例子
https://docs.aws.amazon.com/keyspaces/latest/devguide/using_dotnetcore_driver.html