0

I created a program which work flawlessly on my desktop but when I use the same program on my laptop, it doesn't work. It presents the error "Error: The request was aborted: Could not create SSL/TLS secure channel" on my laptop. I have checked the internet settings and they're the same as my desktop too. The code is below.

    Sub CheckUsername(ByVal word As String)
            Dim WC As New WebClient
            WC.Headers.Add("user-agent", " Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0")
            Dim t As Byte() = WC.DownloadData("https://www.google.com/search?q=" & word) 'This is the line that creates the error'
            Dim headers As WebHeaderCollection = WC.ResponseHeaders
            WC.Dispose()

            If headers.Count = 7 Then
                'MsgBox("True")'
            Else
                'MsgBox("False")'
            End If
    End Sub

I have also tried to add these lines at the start as researched, but it didn't fix the error.

            ServicePointManager.Expect100Continue = True
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
7
  • What Systems do you have installed in those machines? Commented Jul 23, 2022 at 17:27
  • Windows 10 on desktop and Windows Server 2012 R2 on laptop. Commented Jul 23, 2022 at 17:28
  • The Laptop is missing some required Cipher Suites. - Before you say but the WebBrowsers can do that...: WebBrowser bring in and manage their on Cipher Suites. Commented Jul 23, 2022 at 17:29
  • 1
    What version of .NET Framework or .NET are you using? Commented Jul 23, 2022 at 19:28
  • 1
    The following may be helpful: Transport Layer Security (TLS) best practices with the .NET Framework, Solving the TLS 1.0 Problem, 2nd Edition . This post contains some additional resources that you may be interested in reading. Commented Jul 23, 2022 at 19:35

1 Answer 1

0
What frameowrk version ur using ? if 4.6 and above that add like this before call that WebClient.
 



ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls Or SecurityProtocolType.Tls11 Or SecurityProtocolType.Tls12
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.