Merge pull request #5113 from paul-elliott-arm/ssl_opt_fixes_2.x

Backport 2.x : Ssl opt fixes