If the website support downloading without ssl, then don’t use ssl in the url, use http:/
Note: in general it’s better to create a self signed ssl certificate and trust it in the debugging machine
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi!
I have a website in .NET.Core 6 and it works well on runs without SSL on a link with a direct IP address of the type: https:\IP\
Everything works well there, even the files are downloaded from a special Downloads folder.
And I'm currently writing a small application in WPF Core 6 that should download files from this hosting without SSL (from the root or from a specific folder - it doesn't matter).
But when trying to access or download a file, an error related to SSL crashes.
I use these commands:
WebClient webClient = new WebClient();
Version onlineVersion = new Version(webClient.DownloadString("https://IP/Version.txt"));
private string gameZip;
WebClient webClient = new WebClient();
webClient.DownloadFileAsync(new Uri("https://IP/File.zip"), gameZip);
What code should I use to make downloading from such addresses work without SSL support in order to test the program in the debug or in the release?
I tried to solve the issue in different ways:
Does not work
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
Does not work
How to ignore a certificate error with c# 2.0 WebClient - without the certificate
how-to-ignore-a-certificate-error-with-c-sharp-2-0-webclient-without-the-certi
Interestingly, the code:
try
{
//Change SSL checks so that all checks pass
ServicePointManager.ServerCertificateValidationCallback =
new RemoteCertificateValidationCallback(
delegate
{ return true; }
);
}
catch (Exception ex)
{
MessageBox.Show($"ServicePointManager: {ex}");
}
...showed another error, which was not 404 on the server before. After running this code, my server started sending this error all the time via direct links in the browser, as if this code had remotely forbidden it to do this, although direct links had worked before and I could download files using direct links in the browser. It looks like some kind of mysticism. On the server in MIME-types are allowed .txt and .zip to download.
Now I can't even download the same files via a direct link in the browser... (
Please tell me how I can allow the WPF Core app to download files from a remote hosting by a line like https:\IP \?
I don't need to buy SSL and install it now.
Thanks!
If the website support downloading without ssl, then don’t use ssl in the url, use http:/
Note: in general it’s better to create a self signed ssl certificate and trust it in the debugging machine