CURL bug/user error?

I have the following code:

public string url = "http://my.ip.address.221/betsinplay.txt"; //
    private bool isDownloaded;
    private string downloadedText;

    IEnumerator Checkforbetsinplay()
    {
        using (UnityWebRequest www = UnityWebRequest.Get(url))
        {
            yield return www.SendWebRequest();

            if (www.result == UnityWebRequest.Result.Success)
            {
                downloadedText = www.downloadHandler.text;
                isDownloaded = true;
                // Check downloadedText for true or false
                if (downloadedText.ToLower() == "true")
                {
                    // Do something if the value is true
                    Debug.LogError("BETSINPLAY IS TRUE");
                }
                else if (downloadedText.ToLower() == "false")
                {
                    // Do something if the value is false
                    Debug.LogError("BETSINPLAY IS FALSE");
                }
                else
                {
                    // Handle unexpected values
                    Debug.LogError("Downloaded text format not recognized (expected 'true' or 'false')");
                }
            }
            else
            {
                Debug.LogError("Download failed: " + www.error);
            }
        }
    }

when I try to run it, i get the following error:
Curl error 1: Protocol "htttps" not supported or disabled in libcurl

now why in the world would it point to a non existant “htttps” protocol? My webserver does redirect http requests to htttps but in the web browser it does so fine without errors,what gives?

Really that code produces that error?? why would it have 3ts, it also isnt asking for https, so, it doesnt seem that this would be it… What sounds more likely is http hasnt been enabled in the project build choices.

Afaik http is disallowed, use https in the connection string.

I was thinking of

Yes you can switch it to allowed but it‘s like embedding your webserver password in the executable from a security point of view, so not really an option.

It is a stupid option, but i can see valid uses, or calls that wouldnt hurt being http

I see valid uses too like internal webservers but I wouldn’t trust a user to know when using http is (reasonably) safe. :wink:

Using both “http” and" https" in the url produces exactly same “htttps” protocol error. Yes script has been recompiled before each build when testing.

weird tbh, ive not had any issues - my external webserver also redirects to https, its not had issues

So, I need a way to bypass valid SSL certificate, i can’t get a vaid one as it won’t have a domain name, only an IP address, using this code:

 public class CertificateBypass : CertificateHandler
    {
        protected override bool ValidateCertificate(byte[] certificateData)
        {
            return true;
        }
    }

works, but only for SendPostRequest(), when I try this method for UnityWebRequest.Get() I get the same error:

Curl error 1: Protocol “htttps” not supported or disabled in libcurl

EDIT: with this version of the code:

 private bool isDownloaded;
    private string downloadedText;

    IEnumerator Checkforbetsinplay()
    {
      
        using (UnityWebRequest www = UnityWebRequest.Get("https://my.ip/betsinplay.txt"))
        {
             www.certificateHandler = null;
            yield return www.SendWebRequest();

            if (www.result == UnityWebRequest.Result.Success)
            {
                downloadedText = www.downloadHandler.text;
                isDownloaded = true;
                // Check downloadedText for true or false
                if (downloadedText.ToLower() == "True")
                {
                    // Do something if the value is true
                    Debug.LogError("BETSINPLAY IS TRUE");
                }
                else if (downloadedText.ToLower() == "False")
                {
                    // Do something if the value is false
                    Debug.LogError("BETSINPLAY IS FALSE");
                }
                else
                {
                    // Handle unexpected values
                    Debug.LogError("Downloaded text format not recognized (expected 'true' or 'false')");
                }
            }
            else
            {
                Debug.LogError("Download failed: " + www.error);
            }
        }
    }

I’ve made some progress:
Curl error 60: Cert verify failed. Certificate is not correctly signed by a trusted CA. UnityTls error code: 7

What exactly happens when you use the certificate handler? (as your code is not using it)

I gave up, registered a free subdomain on afraid.org and setup an ssl certificate. Gl to anyone struggling with exactly this.