SSL and Encryptions samples fixes

This is several fixes I had to implement to make SSL en encryption samples work. Hope this can help others for future releases...