This project has moved and is read-only. For the latest updates, please go here.

Owin.Testing.TestServer and HTTPS requests

Sep 29, 2014 at 6:15 PM
Edited Sep 29, 2014 at 6:29 PM
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);
Sep 30, 2014 at 3:43 AM
Oct 3, 2014 at 9:28 AM
Is there a way to still use relative paths but with the HTTPS scheme?
Oct 3, 2014 at 5:15 PM
You should be able to reset the BaseAddress field on a new HttpClient .