{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/2025","repository_url":"https://api.github.com/repos/swagger-api/swagger-ui","labels_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/2025/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/2025/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/2025/events","html_url":"https://github.com/swagger-api/swagger-ui/issues/2025","id":139903077,"number":2025,"title":"seeking guidance to resolve mixed content error","user":{"login":"deepsnow","id":334971,"avatar_url":"https://avatars.githubusercontent.com/u/334971?v=3","gravatar_id":"","url":"https://api.github.com/users/deepsnow","html_url":"https://github.com/deepsnow","followers_url":"https://api.github.com/users/deepsnow/followers","following_url":"https://api.github.com/users/deepsnow/following{/other_user}","gists_url":"https://api.github.com/users/deepsnow/gists{/gist_id}","starred_url":"https://api.github.com/users/deepsnow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deepsnow/subscriptions","organizations_url":"https://api.github.com/users/deepsnow/orgs","repos_url":"https://api.github.com/users/deepsnow/repos","events_url":"https://api.github.com/users/deepsnow/events{/privacy}","received_events_url":"https://api.github.com/users/deepsnow/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-10T14:29:45Z","updated_at":"2016-03-10T19:32:06Z","closed_at":null,"body":"Hello,\r\n\r\nI'm a new guy on a team that's created an amazing web app (AngularJS, ASP.NET, and Swagger integrated with Swashbuckle 5.1.5). We have developers who host and access the web app over http, and customers who run it over https.\r\n\r\nThe customers who host/access the web app over https, and who attempt to use the app's Swagger page to interact with the app's REST API, are seeing errors like this one:\r\n\r\nMixed Content: The page at 'https://ourhost.com/swagger/ui/index#!/User/User_Get' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://ourhost.com:443/api/user'. This request has been blocked; the content must be served over HTTPS.\r\n\r\n(I'm not yet sure how that \":443\" got tacked on there...)\r\n\r\nI've reviewed https://github.com/swagger-api/swagger-ui/issues/1006 and https://github.com/swagger-api/swagger-ui/issues/1382 and https://github.com/domaindrivendev/Swashbuckle/issues/296 but I'm not sure how to bring about a remedy.\r\n\r\nI'm tempted to change SwaggerConfig.cs.pp, which currently has a line that reads\r\n\r\n//c.Schemes(new[] { \"http\", \"https\" });\r\n\r\nto read\r\n\r\nc.Schemes(new[] { \"http\", \"https\" });\r\n\r\nor to read\r\n\r\nc.Schemes(new[] { \"https\", \"http\" });\r\n\r\nbut I'm fearful that in doing so I might break Swagger functionality for the developers who run over http.\r\n\r\nWhat can I do to make our app's Swagger page function properly whether our app is hosted and accessed through http or https?\r\n\r\nWhat additional information should I provide here so that you can guide me aright?\r\n\r\nThanks,"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/comments/195011231","html_url":"https://github.com/swagger-api/swagger-ui/issues/2025#issuecomment-195011231","issue_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/2025","id":195011231,"user":{"login":"webron","id":241629,"avatar_url":"https://avatars.githubusercontent.com/u/241629?v=3","gravatar_id":"","url":"https://api.github.com/users/webron","html_url":"https://github.com/webron","followers_url":"https://api.github.com/users/webron/followers","following_url":"https://api.github.com/users/webron/following{/other_user}","gists_url":"https://api.github.com/users/webron/gists{/gist_id}","starred_url":"https://api.github.com/users/webron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webron/subscriptions","organizations_url":"https://api.github.com/users/webron/orgs","repos_url":"https://api.github.com/users/webron/repos","events_url":"https://api.github.com/users/webron/events{/privacy}","received_events_url":"https://api.github.com/users/webron/received_events","type":"User","site_admin":false},"created_at":"2016-03-10T19:32:06Z","updated_at":"2016-03-10T19:32:06Z","body":"I really have no idea how Swashcbukle works or what it does - you'd have to ask the question on its repo. If you see the `schemes` output even though you don't specify it, then 'something' puts it in there as Swashcbukle is the spec generator in this case.\r\n\r\nBefore going down that route, if you want, you can just save the file locally, manually remove the schemes, and host it in your app server as a static file both with http and https access. Then use both to access the file and check if that resolves your issue. If so, then you can try figuring out how to remove it from the generated spec."}}