I experience the same problem and I guess it has to do with php 5.6 and certificate peer verification.
Below is a bug report that gives some extra information.
(
https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1227148.html)
I tried to solve this with the ca-certificates package (I and running my own CA) and all possible checks tell me that this
is installed correct but round cube imap-login still reports problems. Maybe the php code has to be changed so the
correct CApath is used. I also tried to edit php.ini with the openssl.capath option but this didn't solve the problem for me.
I am running 0.8.7. I guess newer version also experience this problem when connecting to imap with ssl