Set basic auth header on connection if credentials are defined