The root cause of your problem is that you have installed libssl1.1 from a PPA (probably ppa:ondrej/apache2), and that version seems to be incompatible with python-imaplib2 (which is required for offlineimap).

Aptitude already made proposal how to correct this - downgrade libssl-dev, libssl1.1 and openssl to the version delivered in the standard Ubuntu repositories.
I do not know for which purpose you have added the PPA; so I cannot judge what effects this downgrade would have on other packages that you have installed.

Another potential way to solve the problem could be to install a python-imaplib2 version 2.57-5 package on your system. The package for cosmic might be a good candidate.