delphi - ssl httpserver throwing 'Access violation at address 00000000. Read of address 00000000' error -
this code throwing 'access violation @ address 00000000. read of address 00000000' error in runtime. i'm trying server accept ssl requests having real trouble.
i have ssleay32.dll & libeay32.dll saved in debug folder. appreciated:
serveriohandler := tidserveriohandlersslopenssl.create; serveriohandler.ssloptions.method := sslvsslv23; serveriohandler.ssloptions.mode := sslmclient; serveriohandler.ssloptions.verifymode := []; serveriohandler.ssloptions.verifydepth := 0; server:=tidhttpserver.create; server.iohandler := serveriohandler; server.defaultport:=port; server.bindings.defaultport:=port; server.onquerysslport(8092, newbool); //this line throws error server.autostartsession:=true; server.oncommandget:=idhttpserver1commandget; server.sessiontimeout:=360; server.active:=true;
the reason why error onquerysslport
event, haven't assigned handler for.
the point of onquerysslport
you should write method , assign property of tidhttpserver
object. then method (that you have written) executed everytime event fired:
procedure tform5.myhandler(aport: tidport; var vusessl: boolean); begin // end; procedure tform5.formcreate(sender: tobject); begin server := tidhttpserver.create; server.onquerysslport := myhandler; ... end;
you might more familiary other events tform.oncreate
, ttimer.onexecute
, etc. these work same way: you write piece of code object executes when right time comes.
Comments
Post a Comment