06-20-2018, 01:46 AM
(06-18-2018, 09:58 PM)ioan Wrote: I found a solution and so far works fine:
Code:procedure TIWServerController.IWServerControllerBaseNewSession(aSession: TIWApplication);
var
challengeResponse, challengeFileName: string;
begin
[...]
else if ContainsText(WebApplication.Request.PathInfo, '.well-known/acme-challenge') then
begin
// for let's encrypt
challengeFileName := WebApplication.ApplicationPath + 'wwwroot' + WebApplication.Request.PathInfo.Replace('/', '\');
if TFile.Exists(challengeFileName) then
challengeResponse := TFile.ReadAllText(challengeFileName)
else
challengeResponse := '';
WebApplication.Response.WriteString(challengeResponse);
WebApplication.Terminate;
end;
end;
Hi Ioan,
We had the same issue recently in one of our applications and I'm seriously thinking about adding built-in support for this kind of stuff in IW 15 code base. It will make life much easier :-)
Thanks for sharing your solution