fixed encrypted socket communication, fixes #1897
Merge pull request #2922 from eminn/fix/encryption-maintenance

[backport] fixed encrypted socket communication, fixes #1897