Quantcast
Channel: Questions in topic: "httpwebrequest"
Viewing all articles
Browse latest Browse all 190

Using HTTPS

$
0
0
Hi all! I'm trying to communicate with a backend server using SSL. I tried using WWW, but changing http:// to https:// dowsn't work (it connects, but doesn't check the certificate, so the connection isn't secure). I also tried with UnityWebRequest but happens the same. I'm trying now hit HttpClient from System.Net.Http with the next code: public static async Task DownloadPageAsync(string web) { try { HttpClient cl = new HttpClient(); string body = await cl.GetStringAsync(new Uri(web)); Debug.Log(web); } catch (HttpRequestException e) { Debug.Log(e.InnerException.Message); } catch (Exception ex) { Debug.Log(ex.ToString()); } } When I try it in a web with a bad certificate, it gives an "Error: TrustFailure (The authentication or decryption has failed.)", which is fine. the problem is that good certificates also triggers an error "Error: SecureChannelFailure (The authentication or decryption has failed.)". I'm in the Unity Editor (not compiled to any platform). ¿Anyone knows how to solve this error? ¿Or there is another way to handle SSL connections? Thanks!

Viewing all articles
Browse latest Browse all 190

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>