title: HttpListener Issue
body: <p>I'm writing a console application program as httplistener and using it through jquery and it's working completely true but I want to convert it to https  but i don't know the steps</p>
  
  <p>Here is my code 
  I hope any one can solve it quickly </p>
  
  <p>This is the jquery code which is written in JScript.js file</p>
  
  <pre><code> $(function () {
      //this code is executed when the page's onload event fires
      $("#runSample1").click(function () {
          var userNameJS = $("#uName").val();
          var passwordJS = $("#passw").val();
          $.post("http://localhost:80/", { userName: userNameJS, password: passwordJS }, function (data) {
              alert(data);
          });
  
      });
  });
  </code></pre>
  
  <p>this is the html page </p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;script type="text/javascript" src="Scripts/jquery-1.4.1.js"&gt; &lt;/script&gt;
  
      &lt;script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"&gt; &lt;/script&gt;
      &lt;script type="text/javascript" src="Scripts/JScript.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="Scripts/jquery-1.4.1-vsdoc.js"&gt;&lt;/script&gt;
      &lt;style type="text/css"&gt;
          .style1 {
              width: 109px;
          }
      &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;table&gt;
  
      &lt;tr&gt;
          &lt;td class="style1"&gt;&lt;label &gt;User Name&lt;/label&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input id="uName"  type="text" /&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td class="style1"&gt;&lt;label &gt;Password&lt;/label&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input id="passw"  type="password" /&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td class="style1"&gt;&lt;input id="runSample1"  type="button" value="Send" style="width: 62px"/&gt;  &lt;/td&gt;
      &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and the httplistener code is</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.IO;
  using System.Net;
  using System.Runtime.Serialization;
  using System.Runtime.Serialization.Json;
  using System.Threading;
  using System.Collections.Specialized;
  using System.Collections;
  using System.Security.Cryptography.X509Certificates;
  namespace TestApplication
  {
      class Program
      {
          static void Main(string[] args)
          {
              if (!HttpListener.IsSupported)
              {
                  Console.WriteLine("Windows XP SP2 or Server 2003 is required to use the HttpListener class.");
                  return;
              }
              // Create a listener.
              HttpListener listener = new HttpListener();
              //listener.AuthenticationSchemes = AuthenticationSchemes.Negotiate;
              listener.Prefixes.Add("http://*:8080/");
              //listener.AuthenticationSchemes
              listener.Start();
              Console.WriteLine("Listening...");
              for (; ; )
              {
                  HttpListenerContext ctx = listener.GetContext();
                  new Thread(new Worker(ctx).ProcessRequest).Start();
              }
          }
      }
      [DataContract]
      internal class Person
      {
          [DataMember]
          internal string name;
  
          [DataMember]
          internal int age;
      }
      class Worker
      {
          private HttpListenerContext context;
          public Worker(HttpListenerContext context)
          {
              this.context = context;
          }
  
          public void ProcessRequest()
          {
  
              HttpListenerRequest request = context.Request;
              List&lt;Person&gt; eList = new List&lt;Person&gt;();
              Hashtable formVars = new Hashtable(); 
              Person person;
              for (int i = 0; i &lt;= 10;i++ )
              {
                  person = new Person();
                  person.name = "Pesron " + i;
                  person.age = i;
                  eList.Add(person);
              }
              HttpListenerResponse response = context.Response;
              System.IO.StreamReader reader = new System.IO.StreamReader(request.InputStream, request.ContentEncoding);
              // S contain parameters and values
              string s = reader.ReadToEnd();
              string[] pairs = s.Split('&amp;');
              for (int x = 0; x &lt; pairs.Length; x++)
              {
                  string[] item = pairs[x].Split('=');
                  formVars.Add(item[0],item[1]);
              }
              String userName = formVars["userName"].ToString();
              String password = formVars["password"].ToString();
              //To send any object as json to client
              DataContractJsonSerializer jsonObject = new DataContractJsonSerializer(typeof(List&lt;Person&gt;));
              System.IO.Stream output = response.OutputStream;
              MemoryStream ms = new MemoryStream();
              jsonObject.WriteObject(ms, eList);
              byte[] buffer = ms.ToArray();
              response.ContentType = "text/plain";
              response.ContentEncoding = System.Text.UTF8Encoding.UTF8;
              response.ContentLength64 = buffer.Length;
              //These headers to allow all browsers to get the response
              response.Headers.Add("Access-Control-Allow-Credentials", "true");
              response.Headers.Add("Access-Control-Allow-Origin", "*");
              response.Headers.Add("Access-Control-Origin", "*");
              //This line to write to the resonse
              output.Write(buffer, 0, buffer.Length);
              output.Close();
          }
      }
  }
  </code></pre>