Fix spurious SSL errors

fixes #6981