fix client.py to use tls appropriately