[fpc-pascal] https support; call for testers

sami samibsb at gmail.com
Mon Aug 31 21:05:31 CEST 2015


Hi all, 

I´m follow the same ideia from fpHttpClient by use a event to handle the
creation of
TSSLSocketHandler for fpHttpServer. 

the event handler was implemented this way: 

procedure TForm1.sockHandleEvent(Sender: TObject; const UseSSL: Boolean; out
  aHandler: TSocketHandler);
var
  h: TSSLSocketHandler;
begin
  aHandler := nil;
  if UseSSL then
  begin
    h := TSSLSocketHandler.Create;
// h.RemoteHostName:= ????;
    h.SSLType := stTLSv1;
    h.CertCA.FileName := 'c:\ca_certificate.pem';
    h.Certificate.FileName := 'c:\certificate.pem';
    h.PrivateKey.FileName := 'c:\privatekey.pem';
//  h.KeyPassword := ????;
//  h.PFX.FileName := 'cert.pfx'; / if exists 
    aHandler := h;
  end;
end; 

it work without errors and i can put the server to StartAccepting incoming
connections. 

but when a https request arrives, i get a SIGSEGV error 
on TSSLSocketHandler.Accept method 
line 379 = "Result:=CheckSSL(FSSL.setfd(Socket.Handle));"
because Socket is NIL. looking the code, i could not find
where the TSSLSocketHandler.Socket property would be set. 
  

function TSSLSocketHandler.Accept: Boolean;

begin
  Result:=InitContext(True);
  if Result then
    begin
    Result:=CheckSSL(FSSL.setfd(Socket.Handle)); // here Socket is NIL =
SIGSEGV
    if Result then
      Result:=CheckSSL(FSSL.Accept);
    end;
  FSSLActive:=Result;
end;

So i need some help on this. 

Thanks. 



--
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/https-support-call-for-testers-tp5718919p5722519.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.



More information about the fpc-pascal mailing list