nant / nantcontrib

NAntContrib is the project for tasks and tools that haven't made it into the main NAnt distribution yet or for whatever reason don't belong there.
nantcontrib.sourceforge.net
GNU Lesser General Public License v2.1
51 stars 35 forks source link

IIS web tasks do not support sites with secure bindings #40

Open dezfowler opened 9 years ago

dezfowler commented 9 years ago

The web tasks which derive from NAnt.Contrib.Tasks.Web.WebBase have the iisserver attribute which allows the correct server to be identified as "{hostname}:{port}" e.g. "localhost:80".

However this does not work if the server concerned uses a secure (HTTPS) binding e.g. "localhost:443". It fails to find the server and this results in a "No website is bound to {port}" exception.

The cause of this is in the FindServerInstance method of WebBase which enumerates bindings found under the "ServerBindings" property. Secure bindings do not get added to this collection but are present in the "SecureBindings" property instead msdn reference.

This method should be amended to enumerate both SecureBindings and ServerBindings collections when searching for the server.