How to get XCode to use proxy server?

I am trying to notarize my app using XCode's xcrun aitool but XCode appears to not be capable of honoring the MacOS proxy settings or the standard HTTP_PROXY/HTTPS_PROXY environment variables.

It seems like people have been asking this same question for many years and Apple doesn't have any answer. Has anyone gotten this to work?

How to get XCode to use proxy server?
 
 
Q