I have two projects, one is a WCF service, the other is an ASP.NET MVC site. The service is to be exposed to multip开发者_开发知识库le consumers, including my MVC site. Both the site and the service require access over SSL. I only have one SSL certificate I can use.
Any ideas how I can set these two projects up in IIS?
Thanks in advance.
One idea is to get a wildcard SSL certificate, something like *.mysite.com, and then set up 2 sites with URLs like services.mysite.com and www.mysite.com. You will be able to assign the same SSL cert to both sites. Only catch is that you'll need to use different a different IP or port on one of the sites, otherwise IIS won't know which site is being routed
I think I have solved it. Thanks for your input JonoW.
- I created the MVC site and bound the SSL certificate as normal.
- I then created a subdirectory in the site and copied all my WCF files there.
- In IIS I browsed to the new subdirectory, right-clicked 'Convert to Application'
- I had to copy some assemblies used by my site to the the bin folder of my WCF directory to avoid some 'assembly not found errors'
- I also had to remove/rename some configuration settings in the WCF web.config that had the same keys as configuration settings in my site web.config.
Finally I updated my endpoint binding configurations and it all seemed to work.
Relatively straight-forward in the end. :)
精彩评论