ssl certificate - Indy POP3 with invalid cert -
i have pop3 client uses indy, connects need abort connection when certificate invalid. have ideas?
procedure tpop3client.connectpop3; var status : boolean; i, msgtotal : integer; begin if edssl begin pop3.iohandler := ssl; pop3.usetls := utuseexplicittls; end; status := false; try pop3.username := edusername; pop3.password := edpassword; pop3.connect(edtargethost,edtargetport); if pop3.connected begin msgtotal := pop3.checkmessages; if msgtotal >=1 := 1 msgtotal begin if getmessage(i) begin getheaders; delmessage(i) end; end end; pop3.disconnect end; end;
in tidssliohandlersocketopenssl
component, enable sslvrfpeer
flag in ssloptions.verifymode
property, , optionally assign handler onverifypeer
event if want validate particular details of server's certificate beyond openssl's default validations. if validation fails, ssl/tls handshake terminated error alert, connection closed, , exception raised code.
Comments
Post a Comment