{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/1334","repository_url":"https://api.github.com/repos/aspnet/KestrelHttpServer","labels_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/1334/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/1334/comments","events_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/1334/events","html_url":"https://github.com/aspnet/KestrelHttpServer/issues/1334","id":204317287,"number":1334,"title":"Determining Hosting Environment While Configuring Kestrel and UseHttps","user":{"login":"RehanSaeed","id":2270364,"avatar_url":"https://avatars1.githubusercontent.com/u/2270364?v=3","gravatar_id":"","url":"https://api.github.com/users/RehanSaeed","html_url":"https://github.com/RehanSaeed","followers_url":"https://api.github.com/users/RehanSaeed/followers","following_url":"https://api.github.com/users/RehanSaeed/following{/other_user}","gists_url":"https://api.github.com/users/RehanSaeed/gists{/gist_id}","starred_url":"https://api.github.com/users/RehanSaeed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RehanSaeed/subscriptions","organizations_url":"https://api.github.com/users/RehanSaeed/orgs","repos_url":"https://api.github.com/users/RehanSaeed/repos","events_url":"https://api.github.com/users/RehanSaeed/events{/privacy}","received_events_url":"https://api.github.com/users/RehanSaeed/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"davidfowl","id":95136,"avatar_url":"https://avatars0.githubusercontent.com/u/95136?v=3","gravatar_id":"","url":"https://api.github.com/users/davidfowl","html_url":"https://github.com/davidfowl","followers_url":"https://api.github.com/users/davidfowl/followers","following_url":"https://api.github.com/users/davidfowl/following{/other_user}","gists_url":"https://api.github.com/users/davidfowl/gists{/gist_id}","starred_url":"https://api.github.com/users/davidfowl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidfowl/subscriptions","organizations_url":"https://api.github.com/users/davidfowl/orgs","repos_url":"https://api.github.com/users/davidfowl/repos","events_url":"https://api.github.com/users/davidfowl/events{/privacy}","received_events_url":"https://api.github.com/users/davidfowl/received_events","type":"User","site_admin":false},"assignees":[{"login":"davidfowl","id":95136,"avatar_url":"https://avatars0.githubusercontent.com/u/95136?v=3","gravatar_id":"","url":"https://api.github.com/users/davidfowl","html_url":"https://github.com/davidfowl","followers_url":"https://api.github.com/users/davidfowl/followers","following_url":"https://api.github.com/users/davidfowl/following{/other_user}","gists_url":"https://api.github.com/users/davidfowl/gists{/gist_id}","starred_url":"https://api.github.com/users/davidfowl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidfowl/subscriptions","organizations_url":"https://api.github.com/users/davidfowl/orgs","repos_url":"https://api.github.com/users/davidfowl/repos","events_url":"https://api.github.com/users/davidfowl/events{/privacy}","received_events_url":"https://api.github.com/users/davidfowl/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/aspnet/KestrelHttpServer/milestones/28","html_url":"https://github.com/aspnet/KestrelHttpServer/milestone/28","labels_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/milestones/28/labels","id":2443980,"number":28,"title":"2.1.0","description":null,"creator":{"login":"muratg","id":1808428,"avatar_url":"https://avatars0.githubusercontent.com/u/1808428?v=3","gravatar_id":"","url":"https://api.github.com/users/muratg","html_url":"https://github.com/muratg","followers_url":"https://api.github.com/users/muratg/followers","following_url":"https://api.github.com/users/muratg/following{/other_user}","gists_url":"https://api.github.com/users/muratg/gists{/gist_id}","starred_url":"https://api.github.com/users/muratg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muratg/subscriptions","organizations_url":"https://api.github.com/users/muratg/orgs","repos_url":"https://api.github.com/users/muratg/repos","events_url":"https://api.github.com/users/muratg/events{/privacy}","received_events_url":"https://api.github.com/users/muratg/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":2,"state":"open","created_at":"2017-04-07T19:25:08Z","updated_at":"2017-04-07T19:38:20Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2017-01-31T14:42:11Z","updated_at":"2017-04-07T20:58:32Z","closed_at":null,"body":"In the ASP.NET Core Main method below, how can I determine the hosting environment, so I can switch between different certificate files for HTTPS?\r\n\r\n```\r\npublic sealed class Program\r\n{\r\n    public static void Main(string[] args)\r\n    {\r\n        new WebHostBuilder()\r\n            .UseContentRoot(Directory.GetCurrentDirectory())\r\n            .UseKestrel(\r\n                options =>\r\n                {\r\n                    if ([Development Hosting Environment])\r\n                    {\r\n                        options.UseHttps(\"DevelopmentCertificate.pfx\");\r\n                    }\r\n                    else\r\n                    {\r\n                        options.UseHttps(\"ProductionCertificate.pfx\");\r\n                    }\r\n                })\r\n            .UseIISIntegration()\r\n            .UseStartup<Startup>()\r\n            .Build()\r\n            .Run();\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/comments/292650065","html_url":"https://github.com/aspnet/KestrelHttpServer/issues/1334#issuecomment-292650065","issue_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/1334","id":292650065,"user":{"login":"JunTaoLuo","id":2030323,"avatar_url":"https://avatars2.githubusercontent.com/u/2030323?v=3","gravatar_id":"","url":"https://api.github.com/users/JunTaoLuo","html_url":"https://github.com/JunTaoLuo","followers_url":"https://api.github.com/users/JunTaoLuo/followers","following_url":"https://api.github.com/users/JunTaoLuo/following{/other_user}","gists_url":"https://api.github.com/users/JunTaoLuo/gists{/gist_id}","starred_url":"https://api.github.com/users/JunTaoLuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JunTaoLuo/subscriptions","organizations_url":"https://api.github.com/users/JunTaoLuo/orgs","repos_url":"https://api.github.com/users/JunTaoLuo/repos","events_url":"https://api.github.com/users/JunTaoLuo/events{/privacy}","received_events_url":"https://api.github.com/users/JunTaoLuo/received_events","type":"User","site_admin":false},"created_at":"2017-04-07T20:58:32Z","updated_at":"2017-04-07T20:58:32Z","body":"@Tratcher UseIISIntegration will set PreferHostingUrls after we address https://github.com/aspnet/IISIntegration/issues/352"}}
{"actor":{"display_login":"JunTaoLuo"}}