Skip to content

Commit c4c1983

Browse files
author
Giorgio Tresoldi
committed
MongoDb "sslEnabled" parameter ignored if not exists
1 parent 8125a81 commit c4c1983

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

SharpRepository.MongoDbRepository/MongoDbConfigRepositoryFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public override IRepository<T, TKey> GetInstance<T, TKey>()
2727
}
2828

2929
SslSettings sslSettings = null;
30-
if (Boolean.Parse(RepositoryConfiguration["sslEnabled"]))
30+
if (!String.IsNullOrEmpty(RepositoryConfiguration["sslEnabled"]) && Boolean.Parse(RepositoryConfiguration["sslEnabled"]))
3131
sslSettings = new SslSettings() { EnabledSslProtocols = (SslProtocols)Enum.Parse(typeof(SslProtocols), RepositoryConfiguration["sslProtocol"]) };
3232

3333
return new MongoDbRepository<T, TKey>(RepositoryConfiguration["connectionString"], sslSettings);

0 commit comments

Comments
 (0)