Maybe I misunderstood your source code, but why are you using very old versions(3+ years) of Libtorrent & OpenSSL?
Maybe there is a good reason for it?
I recommend that you atleast update OpenSSL (to version 1.1.1j) for security and privacy reasons. 😄