Owin.Testing.TestServer and HTTPS requests

Sep 29, 2014 at 5:15 PM
Edited Sep 29, 2014 at 5:29 PM
Hello,
just wondering how can I simulate HTTPS requests to TestServer. In my application, I have HTTP-HTTPS redirect middleware with some functionality around. Now, I would like to do HTTPS requests against TestServer - but unfortunately it looks like "htttp://localhost" is hard-coded there.
        public HttpClient HttpClient
        {
            get { return new HttpClient(Handler) { BaseAddress = new Uri("http://localhost/") }; }
        }
Is there any way I haven't spot how to do HTTPS requests against my TestServer? I'm referring to usage of "CreateRequest" method. There's actually way with using HttpClient directly from TestServer and setting it new Uri.
        public Task<HttpResponseMessage> GetAsync()
        {
            _req.Method = HttpMethod.Get;
            return _server.HttpClient.SendAsync(_req);
        }
Coordinator
Sep 30, 2014 at 2:43 AM
Oct 3, 2014 at 8:28 AM
Is there a way to still use relative paths but with the HTTPS scheme?
Coordinator
Oct 3, 2014 at 4:15 PM
You should be able to reset the BaseAddress field on a new HttpClient .