More defensive

Guess I should test before pushing.  This change makes the SSL debug
logging a lot more defensive.
Merge remote-tracking branch 'upstream/master'