Fixes log.debug message in _connect_proxy

This fixes a traceback if log level is set to DEBUG and connecting to a proxy