Some SSL optimizations

Do not merge. Leaving this up to test later, or in case any questions about SSL performance arise.