[CSHARP-2827] C# says invalid certificate error on Linux Centos Created: 31/Oct/19  Updated: 27/Oct/23  Resolved: 05/Dec/19

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

Type: Bug Priority: Major - P3
Reporter: Krati Singh Assignee: Vincent Kam (Inactive)
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

We are using C# driver "Mongo Db driver 2.9.2" in C# API(.NET core version 2.2) deployed in Linux CentOS to connect to Mongo server 4.2 deployed on Linux CentOS. TLS is enabled on Mongo and self signed certificates are used. Same code and certificates are working from Windows machine but on Linux we are getting following error. Please suggest:

A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector

{ AllowedLatencyRange = 00:00:00.0150000 }

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

{ ClusterId : 1, EndPoint : \"Unspecified/ServerName\" }

\", EndPoint: \"Unspecified/ip-ServerName\", State: \"Disconnected\", Type: \"Unknown\", 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.\n at System.Net.Security.SslState.StartSendAuthResetSignal



 Comments   
Comment by Vincent Kam (Inactive) [ 05/Dec/19 ]

Hi krati

I'm glad to hear you were able to resolve this using a server certificate instead of a wild card certificate. This appears to be a known issue in .NET Core 2.x (seeĀ https://github.com/dotnet/corefx/issues/34061), unrelated to our driver. As an alternative option, it appears that upgrading to .NET Core 3.x will also solve the issue on Linux.

Kind regards,

Vincent

Comment by Krati Singh [ 08/Nov/19 ]

We could resolve this by using server certificate instead of wild card certificate.

Comment by Krati Singh [ 04/Nov/19 ]

Please help with some updates on the cause of above issue and probable fix. Thanks in advance!

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