patmandin 0 Posted 6 hours ago Hello, I am revisiting an email application I wrote a while ago, and that I would modify to evaluate TaurusTLS usage. I came across code that may open both a TIdIMAP4 and a TIdSmtp at the same time, but that shares the same TIdSSLIOHandlerSocketOpenSSL component for dealing with SSL stuff. Is it something that works (i.e. each component that uses it will create and get its own SSL work context), or is it a potential source of bugs (if each component that uses it overwrites what the other is doing) ? Share this post Link to post
Remy Lebeau 1529 Posted 5 hours ago (edited) 53 minutes ago, patmandin said: I came across code that may open both a TIdIMAP4 and a TIdSmtp at the same time, but that shares the same TIdSSLIOHandlerSocketOpenSSL component for dealing with SSL stuff. Is it something that works (i.e. each component that uses it will create and get its own SSL work context) No. A single IOHandler object (of any type, SSL or otherwise) cannot be shared by multiple active connections at the same time. Each connection needs its own unique (SSL)IOHandler object while it is connected to a peer. 53 minutes ago, patmandin said: or is it a potential source of bugs (if each component that uses it overwrites what the other is doing) ? Yes. Each (SSL)IOHandler is associated with a single data transport (such as a socket), and a single set of buffers for incoming and outgoing data. Edited 5 hours ago by Remy Lebeau Share this post Link to post