Mongodb 有没有办法在.net中显式设置MongoClient()的TLS密码套件
我想知道像这个++这样的东西是否可能Mongodb 有没有办法在.net中显式设置MongoClient()的TLS密码套件,mongodb,.net-core,mongodb-.net-driver,Mongodb,.net Core,Mongodb .net Driver,我想知道像这个++这样的东西是否可能 var settings = MongoClientSettings.FromConnectionString("mongodb://..."); settings.UseTls = true; settings.SslSettings = new SslSettings() { EnabledSslProtocols = SslProtocols.Tls12 ++ CipherSuites = MyCustomCipherSui
var settings = MongoClientSettings.FromConnectionString("mongodb://...");
settings.UseTls = true;
settings.SslSettings = new SslSettings()
{
EnabledSslProtocols = SslProtocols.Tls12
++ CipherSuites = MyCustomCipherSuites ++
};
var client = new MongoClient(settings);
// DB queries
一些背景:
升级到NET5.0后,在基于ubuntu 18.04的容器上运行的.netcore应用程序中存在一个最有可能导致连接错误的错误:
---> System.IO.IOException: Received an unexpected EOF or 0 bytes from the transport stream.
at System.Net.Security.SslStream.<FillHandshakeBufferAsync>g__InternalFillHandshakeBufferAsync|182_0[TIOAdapter](TIOAdapter adap, ValueTask`1 task, Int32 minSize)
at System.Net.Security.SslStream.ReceiveBlobAsync[TIOAdapter](TIOAdapter adapter)
at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)
at MongoDB.Driver.Core.Connections.SslStreamFactory.CreateStreamAsync(EndPoint endPoint, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelperAsync(CancellationToken cancellationToken)
-->System.IO.IOException:从传输流接收到意外的EOF或0字节。
在System.Net.Security.SslStream.g_uuInternalFillHandshakeBufferAsync | 182_0[TIOAdapter](TIOAdapter adap,ValueTask`1任务,Int32分钟大小)
在System.Net.Security.SslStream.ReceiveBlobAsync[TIOAdapter](TIOAdapter)上
位于System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter适配器,布尔接收优先,字节[]重新验证数据,布尔ISAM)
位于MongoDB.Driver.Core.Connections.SslStreamFactory.CreateStreamAsync(端点端点、取消令牌取消令牌)
位于MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelperAsync(CancellationToken CancellationToken)
- 我无法访问容器配置,无法更改 默认openssl配置
- 目标MongoDb的版本为4.0,支持Tls1.2
- mongodb驱动程序版本为2.12.1
- 使用的.net运行时为5.0.100