Connect timeout on notarize

I am using electron-builder to build, sign, notarized, and publish my application. All of this works perfectly when I am directly connected to the Internet.

When running this from my corporate network that require the use of a proxy server, electron-notarize, which spawns xcrun, gets a connect timeout when trying to upload the signed app to the iTunes server.

How do I get xcrun to use the proxy server? I have the HTTPS_PROXY environment variable set to http://my.proxy.server.name:80 but xcrun is still trying to connect directly to the iTunes server.

The XCode Content Delivery Services framework is just broken. When invoking xcrun altool --notarize-app, the framework uses the embedded JVM at /Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/itms/java/bin/java.

Using some trickery, I can see the java command being invoked and it does not include the -Dhttps.proxyHost and -Dhttps.nonProxyHosts system properties needed to configure the JVM to use the proxy server. As such, it can never, ever work from a corporate network where a proxy server is required to reach the Internet. See https://docs.oracle.com/javase/8/docs/api/java/net/doc-files/net-properties.html for more information!

What am I supposed to do?

Connect timeout on notarize
 
 
Q