Python 2.6.6 didn't accept ssl_sock.write() with bytearray, works correctly without it.

AFAIK the bytearray conversion isn't needed.