title: How to install ssl certificate without IIS in windows server 2016?
body: <p>I have a project based on asp.net core MVC; I want to use an SSL certificate for using https, but when running my project, it didn't show https address. I can't use IIS in my windows server.but in windows 10 everything is ok.</p>
  
  <p>I'm trying install SSL certificate in windows server for using https in my project.</p>
  
  <pre><code>      public static IWebHost BuildWebHost(string[] args)
          {
              var host = "0.0.0.0";
              var http_port = 40000;
              var https_port = 40001;
  
              if (args.Length &gt; 0) host = args[0].Trim();
              if (args.Length &gt; 1) http_port = Convert.ToInt32(args[1].Trim());
              if (args.Length &gt; 2) https_port = Convert.ToInt32(args[2].Trim());
  
  
              return
              WebHost.CreateDefaultBuilder(args)
                      .UseStartup&lt;Startup&gt;()
                      //
                      .UseKestrel(options =&gt;
                      {
                          options.Limits.MaxRequestBodySize = null;
                          options.Limits.MaxRequestBufferSize = null;
                          options.Limits.MaxRequestHeaderCount = 1000;
                          options.Limits.MaxRequestHeadersTotalSize = 256 * 1024;
  
                          options.Listen(IPAddress.Parse(host), http_port);
  
                          using (var store = new X509Store(StoreName.My))
                          {
                              store.Open(OpenFlags.ReadOnly);
                              var certs = store.Certificates.Find(X509FindType.FindBySubjectName, "localhost", false);
                              if (certs.Count &gt; 0)
                              {
                                  var certificate = certs[0];
  
                                  options.Listen(IPAddress.Parse(host), https_port, listenOptions =&gt;
                                  {
                                      listenOptions.UseHttps(certificate);
                                  });
                              }
                          }
                      }).Build();
  
          }
  </code></pre>
  
  <p>I expect the output see <a href="https://0.0.0.0:40001" rel="nofollow noreferrer">https://0.0.0.0:40001</a>, but in windows server I only have <a href="http://0.0.0.0:40000" rel="nofollow noreferrer">http://0.0.0.0:40000</a>.</p>
  
  <p>image of Windows server
  <a href="https://i.stack.imgur.com/KgkoX.png" rel="nofollow noreferrer">Windows server</a></p>
  
  <p>image of Windows 10:
  <a href="https://i.stack.imgur.com/TpWtH.png" rel="nofollow noreferrer">Windows 10</a></p>