Witam!
Chciałbym zrobić launcher, który sprawdzałby aktualizację... Oczywiście jeżeli program dostałby update owy launcher powinien go pobrać i rozpakować... Mam jednak problem z pobieraniem... Stworzyłem taki kod:
using System.Collections;
using System.Collections.Generic;
using System.Net;
using UnityEngine;
public class downloadTest : MonoBehaviour {
//ZMIENNE\\
WebClient webClient = new WebClient ();
//FUNKCJE\\
void Start () {
try
{
webClient.DownloadFile("https://doc-0c-1g-docs.googleusercontent.com/docs/securesc/jd5pduio1hq2kd28r80uc998ld29ur2g/qrp7cao1cphekbmk4vv0kkpfq2ar3e43/1535176800000/09559160446161529501/09559160446161529501/1zqcw5NIGwVSNVzorTRzSrELvryFQiK88?e=download", "sk.zip");
}
catch (WebException e) {
Debug.LogError ("Błąd: " + e + "...");
return;
}
Debug.Log ("Plik został pobrany pomyślnie...");
}
}
Za każdym razem kiedy go odpalam zostaje złapany wyjątek:
System.Net.WebException: Error getting response stream (Write: The authentication or decryption has failed.): SendFailure ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: Invalid certificate received from server. Error code: 0xffffffff800b010a
at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.validateCertificates (Mono.Security.X509.X509CertificateCollection certificates) [0x00000] in <filename unknown>:0
at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.ProcessAsTls1 () [0x00000] in <filename unknown>:0
at Mono.Security.Protocol.Tls.Handshake.HandshakeMessage.Process () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) Mono.Security.Protocol.Tls.Handshake.HandshakeMessage:Process ()
at Mono.Security.Protocol.Tls.ClientRecordProtocol.ProcessHandshakeMessage (Mono.Security.Protocol.Tls.TlsStream handMsg) [0x00000] in <filename unknown>:0
at Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
at System.Net.HttpWebRequest.GetResponse () [0x00000] in <filename unknown>:0
at System.Net.WebClient.GetWebResponse (System.Net.WebRequest request) [0x00000] in <filename unknown>:0
at System.Net.WebClient.DownloadFileCore (System.Uri address, System.String fileName, System.Object userToken) [0x00000] in <filename unknown>:0
at System.Net.WebClient.DownloadFile (System.Uri address, System.String fileName) [0x00000] in <filename unknown>:0
Wspomnę także iż plik jest na dysku google...
A więc moje pytanie brzmi: czy można sprawdzić, czy strona "chce" aby client pobrał plik, a jeżeli tak, to żeby to zrobił?
Proszę o niezwłoczną odpowiedź, oraz z góry dziękuję za pomoc...
P.s. Owy launcher tworzę w unity oraz powyższy kod jest zrobiony pod unity...