You probably want to manually create a UEPConnection (basically what the provider does, check cp_provider.py).

By setting these values in the provider, even if I hit cancel (values aren't written to the config file), trying to do anything that hits the server will fail, because the provider (a singleton) has bad values.

I think this code will still be necessary, but when you write the config, so it is serialized as well as takes effect in the current gui run.