02-04-2019, 06:11 PM
(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;
It seems that the above solution doesn't work with the latest intraweb version. If I try to request http://localhost/.well-known/acme-challenge/aa, the application never gets in IWServerControllerBaseNewSession and returns a "404 not found" error page.