Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

ddbRocks_150730 avatar image
ddbRocks_150730 asked ·

MVC.net application throwing "Could not create SSL/TLS secure channel"

I have one simple MVC.net (Not core) application that further connects to my Astra instance and fetches data from the database. However, while creating a connection to Astra it gives me "Could not create SSL/TLS secure channel" error. I created one simple console application and deploy it at some location and it's working fine. also, the same MVC.net application working fine in my dev machine's IIS.

Based on my understanding I am missing something in my cloud machine. I am struggling to figure out this issue. if anyone have faced similar kind of issue please help me here

driverastracsharp
1 comment
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

This is a FOLLOW UP QUESTION from ASF Cassandra Slack channel. Question asked by Joao R is as follows,


Hi I'm assuming you're on .NET so I'm going to ask a couple of questions to try and help
  • are you using the C# driver? what version?
  • when you say "MVC" are you referring to the old ASP .NET or the new ASP .NET Core? Which version of .NET Framework/.NET Core are you using?
0 Likes 0 · ·

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

It's not clear to me whether the applications you've deployed on locally or on-premise (or wherever) is also connecting to your Astra DB cluster so I'm going to provide an answer which you might have already accounted for.

When connecting to Astra, you will need to download the secure-connect bundle for the DB you're connecting to. The secure-connect bundle contains the SSL/TLS certificates, hostnames for the contact list and CQL port specific to your database.

In your app, you need to make a call to .WithCloudSecureConnectionBundle() to include the path to your secure-connect bundle. For example:

 var session = 
     Cluster.Builder()
         .WithCloudSecureConnectionBundle(@"C:\path\to\secure-connect-communitydb.zip")
         .WithCredentials("erick", "SomeCom9lexPass#ord")
         .Build()
         .Connect();

If you've already done this for your application, please edit your original question and provide the following details:

  • your answers to João Reis' questions

  • the full error message and stack trace

  • a code snippet from one of your working apps showing how it connects to Astra

  • a code snippet from the broken app showing how it connects to Astra

Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.