Zadejte hledaný výraz...

[.NET] Could not create SSL/TLS secure channel

Brandi Maldonado
verified
rating uzivatele
25. 6. 2025 07:57:59
Zdravim komunitu. Mam takyto kod vo vb.net:
      Dim url As String = "https:\\example.com\folder\file.exe"
      Dim destination As String = "C:\path\to\save\downloaded_file.exe"
      Try
            ' Create the request
            Dim Arequest As WebRequest = WebRequest.Create(url)
            Arequest.Method = "GET"
            ' Get the response stream and write it to a file
            Using response As WebResponse = Arequest.GetResponse()
                Using Astream As Stream = response.GetResponseStream()
                    Using fileStream As New FileStream(destination, FileMode.Create, FileAccess.Write)
                        Astream.CopyTo(fileStream)
                    End Using
                End Using
            End Using
            Console.WriteLine("Download completed successfully.")
        Catch ex As Exception
            Console.WriteLine("Error downloading file: " & ex.Message)
        End Try
v ofise mi funguje bezchybne, na roznych systemoch (win 10 a win 11). na domacom pocitaci dostanem chybu: Could not create SSL/TLS secure channel.
Obidva environmenty su rovnake: 64 bitovy system, Visual Studio 2019 Community ver. 16.11. Zaujimave je, ze z domaceho pocitaca mi WinSCP funguje bezchybne so SFTP. Ked zadam doma v browseri url na stiahnutie exe, tak mi to v pohode stiahne, aj vlastne vsetky operacie mimo VS2019 funguju korektne.
Takze tam nebude nejaky blocker / filter podla IP, alebo tak nieco (na serveri). Doma mam slovensku IP adresu, v ofise rakusku.
Skor ako zacnem otravovat vlastnika serveru, tak sa chcem opytat, ci niekoho nenapada, v com by mohol byt problem? Vychadza mi to tak, ze niekde v .NET, alebo VS2019, ale ozaj netusim kde.
Dik za Vas cas.
25. 6. 2025 07:57:59
https://webtrh.cz/diskuse/net-could-not-create-ssl-tls-secure-channel#reply1537682
Gethly.com
verified
rating uzivatele
25. 6. 2025 10:19:42
Najskor ta binarka, ktoru skompilujes, nema povolenie pristupit na internet. Takze by som pozrel na nastavenia firewallu.
25. 6. 2025 10:19:42
https://webtrh.cz/diskuse/net-could-not-create-ssl-tls-secure-channel#reply1537686
Pro odpověď se přihlašte.
Přihlásit