Skip to content

Commit

Permalink
Adds SSL config
Browse files Browse the repository at this point in the history
  • Loading branch information
JMeyer authored and JMeyer committed Dec 23, 2016
1 parent 2980e1c commit 7bb1736
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace RightpointLabs.Pourcast.Infrastructure.Persistence
using System.Security.Authentication;

namespace RightpointLabs.Pourcast.Infrastructure.Persistence
{
using MongoDB.Driver;

Expand All @@ -8,8 +10,11 @@ public class MongoConnectionHandler : IMongoConnectionHandler

public MongoConnectionHandler(string connectionString, string database)
{
MongoServer server = new MongoClient(connectionString).GetServer();
_database = server.GetDatabase(database);
var settings = MongoClientSettings.FromUrl(new MongoUrl(connectionString));
settings.SslSettings = new SslSettings() { EnabledSslProtocols = SslProtocols.Tls12 };
MongoServer server = new MongoClient(settings).GetServer();

_database = server.GetDatabase(database);
}

public MongoDatabase Database
Expand Down

0 comments on commit 7bb1736

Please sign in to comment.