Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by MikeMcDonald · Jul 01, 2015 at 09:53 AM · bugconnectionhttpsssltimeout

HTTPS (SSL) initial connection timeout bug

We are having an issue establishing connections using SSL (https) that seemed to start occurring when we upgraded to the latest version of Unity(5.1) from 4.6.

The first https call we make will often have to timeout once or twice before succeeding when we retry the connection - sometimes it fails to connect after several retries.

We are using the UniWeb plugin, but we have traced the issue down to the following call:

 connection.stream = new SslStream (connection.client.GetStream (), false, ValidateServerCertificate);
 var ssl = connection.stream as SslStream;
 ssl.AuthenticateAsClient (uri.Host);

ssl.AuthenticateAsClient() will timeout when the bug occurs. This happens in the editor and on iOS and Android devices. The AuthenticateAsClient call is a .Net2 call that Unity is interpreting which leads me to believe the bug is with Unity. We have tried multiple ways of making the call (async, other networking plugins, etc.) yet the bug persists. We have tried against multiple servers and multiple https calls.

Another odd correlation we see is that, when working in the editor, the initial https call will succeed the first time as we run the app throughout the day until we restart Unity and then we can reliably trigger the bug where the call will take multiple attempts before succeeding. However, The bug will also happen while working in the editor throughout the day, but it will almost always happen repeatedly within the first 10-15 minutes of opening Unity.

We are losing customers because of this bug, any knowledge about an upcoming fix or current fix would be greatly appreciated!

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Lars-Blaabjerg · Aug 31, 2015 at 08:16 AM 0
Share

I have the same, or at least very similar, problem. After upgrading to Unity 5, SslStream.AuthenticateAsClient randomly fails.

In the editor I get this exception: $$anonymous$$ono.Security.Protocol.Tls.TlsException: Couldn't complete EndRead at $$anonymous$$ono.Security.Protocol.Tls.SslStreamBase.EndRead (IAsyncResult asyncResult) [0x00000] in :0 at System.Net.Security.SslStream.EndAuthenticateAsClient (IAsyncResult asyncResult) [0x00000] in :0 at System.Net.Security.SslStream.AuthenticateAsClient (System.String targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, SslProtocols sslProtocolType, Boolean checkCertificateRevocation) [0x00000] in :0 at System.Net.Security.SslStream.AuthenticateAsClient (System.String targetHost) [0x00000] in :0 ....

I don't see the same behaviour with the first call working though. For me it is random. But usually it will either not work for a period or work for a period. As if depending on some external service's availability. This is regardless of which host I try to connect to.

This is a VERY serious issue. It completely blocks reliable use of SslStream

avatar image mekjal · Sep 18, 2015 at 12:36 PM 1
Share

Can we bump this up? We have the exact same errors and issues as you guys

avatar image Bunny83 · Sep 18, 2015 at 02:38 PM 0
Share

Well, everyone who can reproduce this bug should file a detailed bugreport in Unity. UnityAnswers isn't a place to report bugs as this site is mainly run by the community and not the Unity staff. The more people complain about an issue that can be reproduced the more likely it is to get a fix.

When you file a bug report make sure you include as much information as possible. Where your server is located (LAN / WAN) if you have other software that connects to the same server without the problem. Attach an example project which they can be used to reproduce the problem. Do you actually have a valid SSL certificate (+provider) or do you go the "hacky" route? Any known hardware in between the endpoints? (Firewall, NAPT-router, load-balancer, ...)

avatar image tcadmin · Oct 05, 2015 at 03:19 PM 0
Share

We are suffering from the exact same issue and it's also occuring with Unity 4.6.

Do you have found any alternative to SslStream?

avatar image cdd990 · Mar 09, 2016 at 05:56 AM 0
Share

https://issuetracker.unity3d.com/issues/system-dot-net-dot-security-dot-sslstream-sslstream-dot-authentica$$anonymous$$sclient-times-out-randomly

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Is it possible to do ssl certificate pinning in Unity iOS 1 Answer

WWW with HTTPS on Android not working 0 Answers

Manually validating SSL certificates (no WWW involved) 1 Answer

POST a form over HTTPS with unvalidated SSL Certificate 2 Answers

WWW and SSL on Android 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges