Alright, so it was a bit more involved than just toggling on the UseSSL since I had to define a custom TSSLSocketHandlerClass that overrode:
- function CreateCertificateData: TCertificateData; override;
- function CreateCertGenerator: TX509Certificate; override;
and then a custom TX509Certificate class that can read the bytes of private/public key (needs to already be created with openssl).
Now that I've done that though, I no longer get SSL errors, but after sending an https request, the server "hangs" indefinitely until I close the client connection, at which point I get
Missing HTTP protocol version in request errorthis was the only forum post I saw that had some relevance, but the OP changed some source... and I'm hoping not do that (I also don't think they were trying https).
https://forum.lazarus.freepascal.org/index.php?topic=40511.0I'm still going down the rabbit hole, but if anyone else knows of some pointers to try, I'm all ears.
edit:
this does appear to be hanging inside of procedure
fphttpserver.ParseStartLine(Request : TFPHTTPConnectionRequest; AStartLine : String); trunk:
procedure ParseStartLine(Request : TFPHTTPConnectionRequest; AStartLine : String);
Function GetNextWord(Var S : String) : string;
Var
P : Integer;
begin
P:=Pos(' ',S);
If (P=0) then
P:=Length(S)+1;
Result:=Copy(S,1,P-1);
Delete(S,1,P);
end;
Var
S : String;
I : Integer;
begin
Request.Method:=GetNextWord(AStartLine);
Request.URL:=GetNextWord(AStartLine);
S:=Request.URL;
I:=Pos('?',S);
if (I>0) then
S:=Copy(S,1,I-1);
If (Length(S)>1) and (S[1]<>'/') then
S:='/'+S
else if S='/' then
S:='';
Request.PathInfo:=S;
S:=GetNextWord(AStartLine);
If (Pos('HTTP/',S)<>1) then
Raise EHTTPServer.CreateHelp(SErrMissingProtocol,400);
Delete(S,1,5);
Request.ProtocolVersion:=trim(S);
end;