1

I have a console application, I can send requests with http, but when I try to send with https, I get an error. When I convert to https I get err connection reset error.

How can we solve this?

 class Program
    {
        static void Main(string[] args)
        {
         
 
            string logFilePath = "log.txt";
            using (StreamWriter logWriter = new StreamWriter(logFilePath, false))
            {
                try
                {
                    var listener = new HttpListener();
                    listener.Prefixes.Add("http://192.168.0.22:7214/");
                    listener.Start();
                    Console.WriteLine("waiting for request");

                    while (true)
                    {
                        var context = listener.GetContext();
                        ProcessRequest(context, logWriter);
                    }
                }
                catch (Exception ex)
                {
                   
                    logWriter.WriteLine("Hata: " + ex.Message);
                    logWriter.WriteLine("Stack Trace: " + ex.StackTrace);
                    logWriter.Flush(); 
                }
            }
        }

listener.Prefixes.Add("http://192.168.0.22:7214/"); address listener.Prefixes.Add("https://192.168.0.22:7214/"); I changed it to but not solved

omercan
  • 11
  • 1

0 Answers0