Backport support for Mysql SSL from 4.0

@tamird @strzalek @eam