Using HTTPS GET in iOS Apps built using C# Unity

public IEnumerator UpdatePlayerDataScoreAndGetRank() {

 string url = "https://www.example.com?abc=2&xyz=23";
 url =  System.Uri.EscapeUriString(url); // Very important

 string dataString = "Some data";
 byte[] byteData = System.Text.Encoding.ASCII.GetBytes(dataString.ToCharArray());

 // Set headers
 Dictionary<string,string> headers = new Dictionary<string, string>();
 headers.Add("Content-Type", "application/json");
 headers.Add("X-Custom-Header", "value");

 WWW wwwReq = new WWW(url, byteData, headers);

 yield return wwwReq;

 if (wwwReq.error == null)
 {
   Debug.Log("DEBUG:Returned Data: " + wwwReq.data);
 }
 else
 {
   Debug.Log("ERROR: " + wwwReq.error);
 }
}

How to setup https (NGINX) for AWS + Unity projects

Step 1. Buy ssl certificate from a vendor. I bought from godaddy because my domain was from godaddy.com

Step2. Create your .key and then a .csr from the .key on the EC2 instance

Step3. The vendor (godaddy in my case) will take the .csr file and give 2 .cert files. These two files will be .csr and bundle*.csr . Combine these as shown here

Step 4. Copy the files in a secure location and use as described here

That’s how I made https://www.gogameserver.com work.

Currently FreakBall uses that as backend.