Problem in this was related with CA certs that are from server. When I use openSSL client to connect to connect to imap server I receive ok response becouse openSSL ignore CA certs warning. It seems that PHP doesn't ignore this warnings. We have to ensure that we have valid CA certs from COMODO RSA Domain Validation Secure Server CA.
I had to import cert from this page and add it to our global certs. After this change I could run fsockopen() without error.