Bug 54058 - Mono not accepting TLS 1.2 connections across platforms
Summary: Mono not accepting TLS 1.2 connections across platforms
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System (show other bugs)
Version: 4.8.0 (C9)
Hardware: Other Linux
: --- normal
Target Milestone: Untriaged
Assignee: Martin Baulig
URL:
Depends on:
Blocks:
 
Reported: 2017-03-27 14:36 UTC by Alex
Modified: 2017-03-27 14:46 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 54058 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Alex 2017-03-27 14:36:13 UTC
Locations issue tested: Raspberry pi, a larger linux server, Mac, and Windows (all with command line Mono usage)

Description of issue: We have written some scripts to access Targetprocess' API to help with our CI process at my company. We use .NET to write small programs and run them on linux servers (be them a small pi or something larger). Right now we are able to run our programs on our Windows machines natively from VS successfully, but should we try to use mono on any platform we see errors (typically very clearly stating TLS issues)
*Knowing that it very well could be our script we also see the errors reproduce using the tlstest.cs instructions provided on the Mono.Security site.

Reproduction: On Linux/RPI I've updated to 4.8 using apt-get and then tried running the tlstest.exe test. Should I point at https://google.com, we see a response of the website. Should I switch over to trying to access our instance of targetprocess - we see the response below: (this is after setting - export MONO_TLS_PROVIDER=btls)

pi@rpi-test-1:~ $ mono tlstest.exe https://www.skyward.tpondemand.com/

https://www.skyward.tpondemand.com/
FAILED: #-2146232800
System.IO.IOException: The authentication or decryption has failed. ---> System.IO.IOException: Error while sending TLS Alert (Fatal:InternalError): System.IO.IOException: The authentication or decryption has failed. ---> System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer. ---> System.Net.Sockets.SocketException: Connection reset by peer
  at System.Net.Sockets.Socket.EndReceive (System.IAsyncResult result) [0x00033] in <5641e4edad4f4464ba58c620a7b8ea48>:0
  at System.Net.Sockets.NetworkStream.EndRead (System.IAsyncResult asyncResult) [0x0005f] in <5641e4edad4f4464ba58c620a7b8ea48>:0
   --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.RecordProtocol.EndReceiveRecord (System.IAsyncResult asyncResult) [0x00040] in <59bcb3a41e31492f91d9513566444e88>:0
  at Mono.Security.Protocol.Tls.SslClientStream.SafeEndReceiveRecord (System.IAsyncResult ar, System.Boolean ignoreEmpty) [0x00000] in <59bcb3a41e31492f91d9513566444e88>:0
  at Mono.Security.Protocol.Tls.SslClientStream.NegotiateAsyncWorker (System.IAsyncResult result) [0x00071] in <59bcb3a41e31492f91d9513566444e88>:0
   --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.SslClientStream.EndNegotiateHandshake (System.IAsyncResult result) [0x0003b] in <59bcb3a41e31492f91d9513566444e88>:0
  at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (System.IAsyncResult asyncResult) [0x0000c] in <59bcb3a41e31492f91d9513566444e88>:0  ---> System.IO.IOException: Unable to write data to the transport connection: The socket is not connected. ---> System.Net.Sockets.SocketException: The socket is not connected
  at System.Net.Sockets.Socket.BeginSend (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags socket_flags, System.AsyncCallback callback, System.Object state) [0x0002b] in <5641e4edad4f4464ba58c620a7b8ea48>:0
  at System.Net.Sockets.NetworkStream.BeginWrite (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.AsyncCallback callback, System.Object state) [0x000b4] in <5641e4edad4f4464ba58c620a7b8ea48>:0
   --- End of inner exception stack trace ---
  at System.Net.Sockets.NetworkStream.BeginWrite (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.AsyncCallback callback, System.Object state) [0x00113] in <5641e4edad4f4464ba58c620a7b8ea48>:0
  at Mono.Security.Protocol.Tls.RecordProtocol.BeginSendRecord (Mono.Security.Protocol.Tls.ContentType contentType, System.Byte[] recordData, System.AsyncCallback callback, System.Object state) [0x00026] in <59bcb3a41e31492f91d9513566444e88>:0
  at Mono.Security.Protocol.Tls.RecordProtocol.SendRecord (Mono.Security.Protocol.Tls.ContentType contentType, System.Byte[] recordData) [0x00000] in <59bcb3a41e31492f91d9513566444e88>:0
  at Mono.Security.Protocol.Tls.RecordProtocol.SendAlert (Mono.Security.Protocol.Tls.Alert alert) [0x00027] in <59bcb3a41e31492f91d9513566444e88>:0
  at Mono.Security.Protocol.Tls.RecordProtocol.SendAlert (System.Exception& ex) [0x00021] in <59bcb3a41e31492f91d9513566444e88>:0
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.SslStreamBase.EndNegotiateHandshake (Mono.Security.Protocol.Tls.SslStreamBase+InternalAsyncResult asyncResult) [0x00028] in <59bcb3a41e31492f91d9513566444e88>:0
  at Mono.Security.Protocol.Tls.SslStreamBase.NegotiateHandshake () [0x00035] in <59bcb3a41e31492f91d9513566444e88>:0
  at Mono.Security.Protocol.Tls.SslStreamBase.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x00076] in <59bcb3a41e31492f91d9513566444e88>:0
  at System.IO.StreamWriter.Flush (System.Boolean flushStream, System.Boolean flushEncoder) [0x00094] in <f712f98eb8e445c8918edaf595bbe465>:0
  at System.IO.StreamWriter.Flush () [0x00006] in <f712f98eb8e445c8918edaf595bbe465>:0
  at TlsTest.GetStreamPage (System.String url) [0x000c2] in <7ad9caa5280c42fa9e47b5cc3d9b1e0e>:0
  at TlsTest.Main (System.String[] args) [0x002aa] in <7ad9caa5280c42fa9e47b5cc3d9b1e0e>:0

Thank you so much for your help and I can be more or less thorough as necessary!