HTTPS with Let's Encrypt
Hi, there are some example to explain how use certificate https in THorse daemon project ? In alternative, there are some example to explain how create an Apache Module and how configure Apache to use it ?
Thank you
Not recommended, but enjoy it: https://www.youtube.com/watch?v=F1hMwxtKJs0
On Apache, you might find a lot's options on Google, since it is a wide known application
Subtitles are available.
Sorry I return on this post ..... I have create an apache module for implement all my RESTful method. Now ... I don't know if this post is in the correct thread but i try ...
The question is ... there is a way to read the Apache "SetEnv" variables from Horse ?
The proble is that in my "BasicAuthorization" callbak I have the necessity to read a config file to access at the DB for validate a user login.
In the normal get/post/put I can access to the "Req.RawWebRequest.PathTranslated" that return me the correct directory of my location and I can load my configuration file ... but in my BasicAuthorization this is not possibile ...
This is my Registry
THorse.AddCallback(BasicAuthorization()).Get('/login', DoGetLogin);
function DoBasicAuthentication(const Username, Password: string): Boolean;
var
Users: TServiceUsers;
begin
Users := TServiceUsers.Create;
try
// {$IFDEF HORSE_APACHE}
// var sx : String := Req.RawWebRequest.PathInfo;
// var sp : String := Req.RawWebRequest.PathTranslated;
// sp := sp.Replace('\','');
// sx := sx.Replace('\','');
// sp := sp.Replace(sx,'') + '/CFG_PGM.ini';
//
// Users.fHomeSetDir := sp;
// {$ENDIF}
//
// Users.ConnectDB;
Result := Users.IsValid(Username, Password);
finally
Users.Free;
end;
end;
function BasicAuthorization: THorseCallback;
begin
Result := HorseBasicAuthentication(DoBasicAuthentication);
end;
Thank's
@SysIbba You can create your own private middleware, basic auth, and pass the Req and Res parameters to it, in addition to the Username and Password.
@SysIbba conseguiu fazer?