[CSHARP-2069] Intermittent timeout when sslverifycertificate=false Created: 19/Oct/17  Updated: 26/Feb/19  Resolved: 26/Feb/19

Status: Closed
Project: C# Driver
Component/s: Connectivity
Affects Version/s: 2.4.4
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: ALOK MEHROTRA Assignee: Vincent Kam (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS: Windows 2012 R2
.NET Version: dotnetcore 1.1
Project Type: Web API
SSL Certificate: Self Signed
Replicaset: Yes, with three members



 Description   

1. Created Data access library (using repository pattern) to access mongo collection.
2. Connecting to DB using new MongoClient(connectionString)
3. Using MongoClient.GetDatabase to get DB.
4. Using IMongoDatabase.GetCollection to fetch data from a collection.

Issue:
In the test environment, started getting exception:

HeartbeatException: "MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.

To solve above, added "sslverifycertificate=false" to the connection string. This solved the certification validation exception, but another intermittent issue cropped up, below is the information:

Connection id ""XXXXXX"": An unhandled exception was thrown by the application.
System.TimeoutException: A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = ReadPreferenceServerSelector{ ReadPreference =

{ Mode : Nearest }

}, LatencyLimitingServerSelector

{ AllowedLatencyRange = 00:00:00.0150000 }

}. Client view of cluster state is { ClusterId : "1", ConnectionMode : "ReplicaSet", Type : "ReplicaSet", State : "Disconnected", Servers : [{ ServerId: "

{ ClusterId : 1, EndPoint : "Unspecified/_MemberServer1_:27017" }

", EndPoint: "Unspecified/MemberServer1:27017", State: "Disconnected", Type: "Unknown" }, { ServerId: "

{ ClusterId : 1, EndPoint : "Unspecified/_MemberServer2_:27017" }

", EndPoint: "Unspecified/MemberServer2:27017", State: "Disconnected", Type: "Unknown" }, { ServerId: "

{ ClusterId : 1, EndPoint : "Unspecified/_MemberServer3_:27017" }

", EndPoint: "Unspecified/MemberServer3:27017", State: "Disconnected", Type: "Unknown" }] }.
at MongoDB.Driver.Core.Clusters.Cluster.ThrowTimeoutException(IServerSelector selector, ClusterDescription description)



 Comments   
Comment by Ian Whalen (Inactive) [ 11/Feb/19 ]

AlMeh apologies for the delay in responding here - we believe that this has been fixed in CSHARP-2279 - can you please update to 2.7.0 and let us know if you're good?

Generated at Wed Feb 07 21:41:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.