<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:44:24 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[CSHARP-3113] Getting &quot;Authentication failed because the remote party has closed the transport stream&quot; while connection mongodb V4.0 using C# driver.</title>
                <link>https://jira.mongodb.org/browse/CSHARP-3113</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;We are trying to implement SSL authentication with the MongoDB 4.0 version using the below connection string and facing authentication issues.&lt;/p&gt;

&lt;p&gt;&#160;&lt;b&gt;mongodb://username:password@hostname:27017/?authSource=admin&amp;amp;readPreference=primary&amp;amp;ssl=true&amp;amp;sslPEMKeyFile=C:/etc/ssl/client.pem&quot;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;At MongoDB log, we see the application connections are closing immediately with error message :&lt;/p&gt;

&lt;p&gt;&lt;b&gt;encountered a network error during SourceMessage: SocketE&lt;/b&gt;&lt;b&gt;xception: no shared cipher&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;application log:&#160;&lt;br/&gt;
2020-02-20 12:39:53 &lt;span class=&quot;error&quot;&gt;&amp;#91;Debug&amp;#93;&lt;/span&gt; Failed to authenticate HTTPS connection.&lt;br/&gt;
 Properties: { EventId: &lt;/p&gt;
{ Id: 1 }
&lt;p&gt;, SourceContext: &quot;Microsoft.AspNetCore.Server.Kestrel.Https.Internal.HttpsConnectionMiddleware&quot;, ConnectionId: &quot;0HLTM5FID0INL&quot;, Application: &quot;DCDService&quot; }&lt;br/&gt;
 MachineName: NB1999-01924579&lt;br/&gt;
 System.IO.IOException: Authentication failed because the remote party has closed the transport stream.&lt;br/&gt;
 &#160;&#160;&#160;at System.Net.Security.SslStream.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)&lt;br/&gt;
 &#160;&#160;&#160;at System.Net.Security.SslStream.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)&lt;br/&gt;
 &#160;&#160;&#160;at System.Net.Security.SslStream.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)&lt;br/&gt;
 &#160;&#160;&#160;at System.Net.Security.SslStream.ProcessAuthentication(LazyAsyncResult lazyResult, CancellationToken cancellationToken)&lt;br/&gt;
 &#160;&#160;&#160;at System.Net.Security.SslStream.BeginAuthenticateAsServer(SslServerAuthenticationOptions sslServerAuthenticationOptions, CancellationToken cancellationToken, AsyncCallback asyncCallback, Object asyncState)&lt;br/&gt;
 &#160;&#160;&#160;at System.Net.Security.SslStream.&amp;lt;&amp;gt;c.&amp;lt;AuthenticateAsServerAsync&amp;gt;b__69_0(SslServerAuthenticationOptions arg1, CancellationToken arg2, AsyncCallback callback, Object state)&lt;br/&gt;
 &#160;&#160;&#160;at System.Threading.Tasks.TaskFactory`1.FromAsyncImpl&lt;span class=&quot;error&quot;&gt;&amp;#91;TArg1,TArg2&amp;#93;&lt;/span&gt;(Func`5 beginMethod, Func`2 endFunction, Action`1 endAction, TArg1 arg1, TArg2 arg2, Object state, TaskCreationOptions creationOptions)&lt;br/&gt;
 &#160;&#160;&#160;at System.Threading.Tasks.TaskFactory.FromAsync&lt;span class=&quot;error&quot;&gt;&amp;#91;TArg1,TArg2&amp;#93;&lt;/span&gt;(Func`5 beginMethod, Action`1 endMethod, TArg1 arg1, TArg2 arg2, Object state, TaskCreationOptions creationOptions)&lt;br/&gt;
 &#160;&#160;&#160;at System.Threading.Tasks.TaskFactory.FromAsync&lt;span class=&quot;error&quot;&gt;&amp;#91;TArg1,TArg2&amp;#93;&lt;/span&gt;(Func`5 beginMethod, Action`1 endMethod, TArg1 arg1, TArg2 arg2, Object state)&lt;br/&gt;
 &#160;&#160;&#160;at System.Net.Security.SslStream.AuthenticateAsServerAsync(SslServerAuthenticationOptions sslServerAuthenticationOptions, CancellationToken cancellationToken)&lt;br/&gt;
 &#160;&#160;&#160;at Microsoft.AspNetCore.Server.Kestrel.Https.Internal.HttpsConnectionMiddleware.InnerOnConnectionAsync(ConnectionContext context)&lt;br/&gt;
&#160;&lt;br/&gt;
&#160;&lt;br/&gt;
&#160;&lt;br/&gt;
&#160;&lt;/p&gt;</description>
                <environment>Production</environment>
        <key id="1363465">CSHARP-3113</key>
            <summary>Getting &quot;Authentication failed because the remote party has closed the transport stream&quot; while connection mongodb V4.0 using C# driver.</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13203">Gone away</resolution>
                                        <assignee username="vincent.kam@mongodb.com">Vincent Kam</assignee>
                                    <reporter username="naresh.kandala@lowes.com">naresh kandala</reporter>
                        <labels>
                    </labels>
                <created>Wed, 27 May 2020 10:09:04 +0000</created>
                <updated>Fri, 27 Oct 2023 19:56:08 +0000</updated>
                            <resolved>Mon, 22 Jun 2020 14:43:23 +0000</resolved>
                                                                    <component>Configuration</component>
                    <component>Connectivity</component>
                                        <votes>1</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="3187330" author="vincent.kam" created="Wed, 3 Jun 2020 14:40:13 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=naresh.kandala%40lowes.com&quot; class=&quot;user-hover&quot; rel=&quot;naresh.kandala@lowes.com&quot;&gt;naresh.kandala@lowes.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thank you for reaching out! I&apos;m sorry to hear that your application is experiencing connectivity issues.&lt;/p&gt;

&lt;p&gt;I see that your connection string uses the &lt;tt&gt;sslPemKeyFile&lt;/tt&gt; option: unfortunately the .NET driver does not support this option yet, so the client certificate will &lt;a href=&quot;https://mongodb.github.io/mongo-csharp-driver/2.10/reference/driver/authentication/#x-509-authentication&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;need to set programmatically&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;One of the steps in setting the client certificate programmatically includes creating an &lt;tt&gt;X509Certificate2&lt;/tt&gt; object, and in order to do so, the client key MAY need to be converted to the PFX/PKCS12 format (see &lt;a href=&quot;https://github.com/dotnet/runtime/issues/27346#issuecomment-419658415&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/dotnet/runtime/issues/27346#issuecomment-419658415&lt;/a&gt;), although I am less certain about this: there may be a way to create an &lt;tt&gt;X509Certificate2&lt;/tt&gt; object directly from a PEM file. What I can definitely say is that for our own test suites, we use &lt;tt&gt;openssl&lt;/tt&gt; to convert the client PEM file into a PFX/PKCS12 formatted file like so:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;openssl pkcs12 -export -in &quot;${CLIENT_PEM}&quot; \&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;  -out &quot;${MONGO_X509_CLIENT_P12}&quot; \&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;  -name &quot;Drivers Client Certificate&quot; \&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;  -password &quot;pass:${MONGO_X509_CLIENT_CERTIFICATE_PASSWORD}&quot; &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                            <comment id="3130932" author="JIRAUSER1252674" created="Wed, 27 May 2020 19:19:37 +0000"  >&lt;p&gt;The application is .netCore 3.1 and using Mongo C# driver - 2.10.3&lt;/p&gt;

&lt;p&gt;Please ignore the above error log. Below is the error we see in the mongoDB log&lt;/p&gt;

&lt;p&gt;&#160;&lt;br/&gt;
-05-26T12:59:09.440-0400 I NETWORK &#160;&lt;span class=&quot;error&quot;&gt;&amp;#91;conn44904&amp;#93;&lt;/span&gt; end connection 172.29.140.200:63941 (36 connections now open)&lt;br/&gt;
 2020-05-26T12:59:09.442-0400 I NETWORK &#160;&lt;span class=&quot;error&quot;&gt;&amp;#91;listener&amp;#93;&lt;/span&gt; connection accepted from 172.29.140.200:63942 #44905 (37 connections now open)&lt;br/&gt;
 2020-05-26T12:59:09.443-0400 I NETWORK &#160;&lt;span class=&quot;error&quot;&gt;&amp;#91;conn44905&amp;#93;&lt;/span&gt; end connection 172.29.140.200:63942 (36 connections now open)&lt;br/&gt;
 2020-05-26T12:59:09.955-0400 I NETWORK &#160;&lt;span class=&quot;error&quot;&gt;&amp;#91;listener&amp;#93;&lt;/span&gt; connection accepted from 172.29.140.200:63943 #44906 (37 connections now open)&lt;br/&gt;
 2020-05-26T12:59:09.956-0400 I NETWORK &#160;&lt;span class=&quot;error&quot;&gt;&amp;#91;conn44906&amp;#93;&lt;/span&gt; end connection 172.29.140.200:63943 (36 connections now open)&lt;br/&gt;
 2020-05-26T12:59:09.958-0400 I NETWORK &#160;&lt;span class=&quot;error&quot;&gt;&amp;#91;listener&amp;#93;&lt;/span&gt; connection accepted from 172.29.140.200:63944 #44907 (37 connections now open)&lt;br/&gt;
 2020-05-26T12:59:09.959-0400 I NETWORK &#160;&lt;span class=&quot;error&quot;&gt;&amp;#91;conn44907&amp;#93;&lt;/span&gt; end connection 172.29.140.200:63944 (36 connections now open)&lt;br/&gt;
 2020-05-26T12:59:10.471-0400 I NETWORK &#160;&lt;span class=&quot;error&quot;&gt;&amp;#91;listener&amp;#93;&lt;/span&gt; connection accepted from 172.29.140.200:63945 #44908 (37 connections now open)&lt;br/&gt;
 2020-05-26T12:59:10.472-0400 I NETWORK &#160;&lt;span class=&quot;error&quot;&gt;&amp;#91;conn44908&amp;#93;&lt;/span&gt; end connection 172.29.140.200:63945 (36 connections now open)&lt;br/&gt;
 2020-05-26T12:59:10.474-0400 I NETWORK &#160;&lt;span class=&quot;error&quot;&gt;&amp;#91;listener&amp;#93;&lt;/span&gt; connection accepted from 172.29.140.200:63946 #44909 (37 connections now open)&lt;br/&gt;
 2020-05-26T12:59:10.474-0400 I NETWORK &#160;&lt;span class=&quot;error&quot;&gt;&amp;#91;conn44909&amp;#93;&lt;/span&gt; end connection 172.29.140.200:63946 (36 connections now open)&lt;br/&gt;
 2020-05-26T12:59:10.986-0400 I NETWORK&#160; &lt;span class=&quot;error&quot;&gt;&amp;#91;listener&amp;#93;&lt;/span&gt;&lt;br/&gt;
&#160;&lt;br/&gt;
And below is what we see in the application:&lt;br/&gt;
&#160;&lt;br/&gt;
System.TimeoutException: A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector&lt;/p&gt;
{ AllowedLatencyRange = 00:00:00.0150000 }
&lt;p&gt; }. Client view of cluster state is { ClusterId : &quot;1&quot;, ConnectionMode : &quot;Automatic&quot;, Type : &quot;Unknown&quot;, State : &quot;Disconnected&quot;, Servers : [{ ServerId: &quot;&lt;/p&gt;
{ ClusterId : 1, EndPoint : &quot;Unspecified/lxmdbssisdev001.lowes.com:27017&quot; }
&lt;p&gt;&quot;, EndPoint: &quot;Unspecified/lxmdbssisdev001.lowes.com:27017&quot;, State: &quot;Disconnected&quot;, Type: &quot;Unknown&quot;, HeartbeatException: &quot;MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server.&lt;br/&gt;
 &#160;---&amp;gt; System.IO.IOException: Authentication failed because the remote party has closed the transport stream.&lt;br/&gt;
&#160;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10720">
                    <name>Cloners</name>
                                                                <inwardlinks description="is cloned by">
                                        <issuelink>
            <issuekey id="1422008">CSHARP-3172</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1425434">CSHARP-3174</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hxaf9z:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>