Just to put some context.
ASP.NET MVC2
Web API 5
IIS 7
I am trying to use the WCF Web API and as soon as I enable HTTPS, it stop working.
Things I noticed:
My API call I do through jquery, and I have something like this as the url:
http://www.domain.com/api/serviceApi/SetForeignToken?token=ASDAS-ASDAS-ASDASD-ASDASDAS&foreignToken=AS123ASD
When I use the API test UI I through:
https://www.domain.com/api/serviceApi/Test
I see for the test url:
https://devserver.ad.domain.com/api/serviceapi/SetForeignToken?token=ASDAS-ASDAS-ASDASD-ASDASDAS&foreignToken=AS123ASD
It just seems od the it resolves the DNS to the machine name instead of keeping the normal DNS, as it did before without HTTPS.
Does anyone know how to configure the API to make this work unde HTTPS, or is it even possible?
Thanks,
PS. The Development Enviroment has a self-signed certificate while the production will have a real certificate.
Yes, WCF Web API supports HTTPS. I believe there are a couple of ways to do this (including a code option). I only wanted https enabled on one server so I did this in my web.config: