Search Issue Tracker

Fixed in 5.3.7



Found in


Issue ID




[WebPlayer] [System.Net.Security.SslStream] SslStream.AuthenticateAsClient times out randomly



Reproduction steps:
1. Open attached project
2. Open scene "TestScene"
3. Enter play mode
4. Observe the console logs. If the request completes successfully, "Response received" will be printed. If it fails, indicating the bug has occurred, "Response failed" will be printed. Note, it takes exactly 5 minutes for the failure to occur. If the call does succeed, it typically takes a second or two. Therefore, if you find yourself waiting for more than 10 seconds, you can be reasonably certain the bug will occur.
5. If the bug does not occur, restart the editor and try again (it almost always does occur)

Comments (9)

  1. Lars-Blaabjerg

    May 24, 2016 08:22

    There seems to be a difference in how often it occurs with different websites. I happened to make a test with (our certificate provider) and with that, it happens every time.

    There is a small difference in how far it gets before it times out, but the exception is always "Mono.Security.Protocol.Tls.TlsException: Couldn't complete EndRead".

    Sometimes it gets to call the RemoteCertificateValidationCallback and sometimes it would even complete AuthenticateAsClient, only to fail with the same exception, when proceeding to read the stream.

    Do I need to make a repro project for you?

  2. Lars-Blaabjerg

    May 23, 2016 13:54

    And also 5.3.5f1

  3. albal

    May 23, 2016 11:43

    Seeing it also in 5.3.4f1.

  4. Lars-Blaabjerg

    May 23, 2016 11:09

    I'm seeing this in 5.3.4f1. Please fix it.

  5. cdd990

    Mar 09, 2016 05:42

    I'm currently using Unity5.3.1p2, this issue still

  6. phodges

    Jan 05, 2016 12:25

    Not so much randomly, as entirely predictably for us when running in the windows editor in 5.3.1f1: play in editor once, shutdown and play again and we hit this snag. Here's some callstack:

    1/5/2016 11:39:27 AM|FATAL|WebSocket.acceptException|Mono.Security.Protocol.Tls.TlsException: Couldn't complete EndRead
    at Mono.Security.Protocol.Tls.SslStreamBase.EndRead (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
    at System.Net.Security.SslStream.EndAuthenticateAsClient (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
    at System.Net.Security.SslStream.AuthenticateAsClient (System.String targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, SslProtocols sslProtocolType, Boolean checkCertificateRevocation) [0x00000] in <filename unknown>:0
    at System.Net.Security.SslStream.AuthenticateAsClient (System.String targetHost) [0x00000] in <filename unknown>:0
    at WebSocketSharp.WsStream.CreateClientStream (System.Net.Sockets.TcpClient client, Boolean secure, System.String host, System.Net.Security.RemoteCertificateValidationCallback validationCallback) [0x00000] in <filename unknown>:0
    at WebSocketSharp.WebSocket.setClientStream () [0x00000] in <filename unknown>:0
    at WebSocketSharp.WebSocket.doHandshake () [0x00000] in <filename unknown>:0
    at WebSocketSharp.WebSocket.connect () [0x00000] in <filename unknown>:0
    An exception has occurred while connecting.

  7. KJoanette

    Sep 09, 2015 11:27

    This is incredibly important and needs to be addressed ASAP. There are a good number of us stuck on this one and requiring to roll our own native networking to support SSL.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.