I am using MWA to create FTP sites on an IIS 7 machine, as is outlined at this other forum post - http://forums.iis.net/t/1150298.aspx. The code below, which performs the function of "setting" the server certificate hash value in the configuration, works perfectly.
sslElement["serverCertHash"] = ConfigurationManager.AppSettings["FtpServerCertHash"];
sslElement["controlChannelPolicy"] = "SslAllow";
sslElement["dataChannelPolicy"] = "SslAllow";
The problem I have, however, is that I'll be creating numerous sites using this code on various servers, and the use of the appSetting isn't realistic. What I need the code to do, at run-time, is to ask the targeted server "could you please tell me your SSL cert?" I'll use the value given to me by the server in the code. In this way, numerous FTP sites will use the same key, but the key will be variant from server to server.
The idea here is to automate the selection of an SSL key, as is provided by the "SSL Certificate" in the "FTP SSL Settings" section of the IIS Manager, and to pre-select the first item in the list, but to do it programmatically at the time the FTP site is created.
Is this possible, and if so, can it be done using MWA or MWM?