Work around MemoryError when using an SSL endpoint