0

I'm sorry for reposting this question. Just couldn't find an answer that was working for me.

Problem

This error occurs with Louis Vuitton's website but not with for example a specific ebay listing... "The underlying connection was closed: An unexpected error occurred on a receive. ---> System.ComponentModel.Win32Exception: The client and server cannot communicate, because they do not possess a common algorithm " This is the console's output after running the following code and I can't figure out why:

public static string checkThisProduct = "https://en.louisvuitton.com/eng-nl/products/time-out-trainers-nvprod2750020v";
        static void Main(string[] args)
        {
            GetInfoFromWeb(checkThisProduct);
        }
        public static void GetInfoFromWeb(string url)
        {
            try
            {
                ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls13;
                using (WebClient wb = new WebClient())
                {
                    string info = wb.DownloadString(url);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }

Already Tried

Tried running this with no luck:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls13 | SecurityProtocolType.Tls12;

Can this community help me out?

17
  • Webclient is a bit old. Now we use httpclient. Anyhow, is there an inner exception? Commented Mar 31, 2021 at 20:30
  • when removing that try catch statement, the console gives: gives a long message: Unhandled Exception: System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.ComponentModel.Win32Exception: The client and server cannot communicate, because they do not possess a common algorithm Commented Mar 31, 2021 at 20:33
  • Hint is in the last sentence of the error. Commented Mar 31, 2021 at 20:55
  • Does this answer your question? ..The underlying connection was closed: An unexpected error occurred on a receive Commented Mar 31, 2021 at 20:58
  • Stepping back a bit... what do you intend to do with the downloaded string? That site has lots of javascript and your downloaded string will not have the same content as what you see in the browser. Commented Mar 31, 2021 at 21:00

0

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.