title: asp.net-core 2.0 Unable to configure HTTPS endpoint
body: <p>I developed application in asp.net-core 2.0 preview1. I developed it on windows with Visual Studio 2017.</p>
  
  <p>Now I want to deploy it to Linux server using Docker.</p>
  
  <p>I created Docker image on windows.</p>
  
  <p>Docker file is:</p>
  
  <pre><code>FROM microsoft/aspnetcore:2.0
  ARG source
  WORKDIR /app
  EXPOSE 44305
  COPY ${source:-obj/Docker/publish} .
  ENTRYPOINT ["dotnet", "Application.Web.dll"]
  </code></pre>
  
  <p>After that running commands:</p>
  
  <pre><code>dotnet build -o obj/Docker/publish -c Release
  dotnet publish -o obj/Docker/publish -c Release
  docker build -t testapi-api .
  </code></pre>
  
  <p>Then I deplyoed image on linux server with Docker and run it:</p>
  
  <pre><code>docker run -p 44305:80 --name api testapi-api
  </code></pre>
  
  <p>But I am getting error:</p>
  
  <pre><code>Unhandled Exception: System.InvalidOperationException: Unable to configure HTTPS endpoint. For information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054. ---&gt; System.Collections.Generic.KeyNotFoundException: No certificate named 'HTTPS' found in configuration for the current environment (Production).
         at Microsoft.AspNetCore.CertificateLoader.LoadSingle(String certificateName)
         at Microsoft.AspNetCore.CertificateLoader.Load(IConfigurationSection certificateConfiguration)
         at Microsoft.AspNetCore.KestrelServerOptionsSetup.&lt;&gt;c__DisplayClass6_0.&lt;BindEndPoint&gt;b__0(ListenOptions listenOptions)
         --- End of inner exception stack trace ---
         at Microsoft.AspNetCore.KestrelServerOptionsSetup.&lt;&gt;c__DisplayClass6_0.&lt;BindEndPoint&gt;b__0(ListenOptions listenOptions)
         at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions.Listen(IPEndPoint endPoint, Action`1 configure)
         at Microsoft.AspNetCore.KestrelServerOptionsSetup.BindEndPoint(KestrelServerOptions options, IConfigurationSection endPoint, CertificateLoader certificateLoader)
         at Microsoft.AspNetCore.KestrelServerOptionsSetup.BindConfiguration(KestrelServerOptions options)
         at Microsoft.Extensions.Options.LegacyOptionsCache`1.CreateOptions()
         at System.Threading.LazyInitializer.EnsureInitializedCore[T](T&amp; target, Boolean&amp; initialized, Object&amp; syncLock, Func`1 valueFactory)
         at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.CreateServiceContext(IOptions`1 options, ILoggerFactory loggerFactory)
         at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer..ctor(IOptions`1 options, ITransportFactory transportFactory, ILoggerFactory loggerFactory)
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)
         at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
         at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
         at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureServer()
         at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
         at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
         at XTrader.Web.Program.Main(String[] args) in C:\wamp64\www\app\Application.Web\Program.cs:line 17
  </code></pre>
  
  <p>I followed instructions from <a href="https://docs.microsoft.com/en-us/aspnet/core/security/https" rel="nofollow noreferrer">here</a>, but nor sure if I did everything fine.</p>
  
  <p>Tried to create <code>certificate.pfx</code> and add it to project but that doesn't seems to work. </p>
  
  <p>If someone can help me to figure out how to get it working in this case when deploying to linux server.</p>