Hi,
Our team noticed occasional reports of users being unable to communicate with our web service over https.
After seeing occasional reports from players being unable to connect to our game, we built a system that captures the error event when it occurs and gives us a bit more context about the error. To our surprise we found that the issue happens hundreds of times each day for over 200 unique users.
The specific error message we see is: “Unable to complete SSL connection”
Specifically, this error occurs for a limited set of users when we make calls like the one below. For the vast majority of our users, including ALL of inhouse staff, we’re unable to recreate this problem and everything works fine. But for over 200 unique users each day we get lots of reports of “Unable to complete SSL connection” which fires as a part of a isNetworkError response:
UnityWebRequest www = UnityWebRequest.Post("https://www.oursite.com/example", form);
StartCoroutine(WaitForRequestLoad(www));
private IEnumerator WaitForRequestLoad(UnityWebRequest www)
{
using (www)
{
yield return www.SendWebRequest();
if (www.isHttpError)
{
// HttpError
}
else if (www.isNetworkError)
{
// THIS IS WHERE THE PROBLEM OCCURS
// www.error = "Unable to complete SSL connection"
}
else if(www.error != null)
{
// Double check no error messages
}
else
{
// EVERYTHING WORKS FINE, PROCEED NORMALLY
}
}
}
We’ve seen this problem across many similar calls in our game, including plenty of WebAPI calls and AssetBundle loads using UnityWebRequestAssetBundle.GetAssetBundle().
We’ve found this to be a problem for users across platforms including Android, iOS, and Standalone builds of our game. We’ve checked our SSL configuration on the server and things look ok. Given that we can not recreate the problem inhouse it’s difficult to troubleshoot for users. We’ve reached out to several of these users and haven’t been able to arrive at a conclusion why they’re having issues. For a while now we’ve blamed their local isp or local configurations, but it now seems like there are too many reports for this to make sense.
It would be super helpful if we could get some information on what is happening behind the scenes when calling UnityWebRequest.Post() that could result in the SSL error we’re seeing. Any information about this would help us troubleshoot if there is something wrong on our end or a problem with the editor.
The one interesting point is that ALL of the users that have reported this issue have confirmed that they can successfully access the same URL from a web browser on the same device. This made us think that maybe something was wrong at the Unity level.