Fix Socket encryption error message
Thrown object should be an Exception instance
Merge pull request #2286 from majna/3.0-socket

3.0 socket