Is it possible to use gradle with VPN app in MAC?

I am trying to build Android app with gradle, while doing so I need to download dependencies from our office VPN network. To connect to our office network, we use VPN app in mac. If I connected to VPN, gradle build fails with below error.

Operation timed out (Connection timed out). If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle.

I do not configure proxy in project’s and global but gradle throws “ Operation timed out”. If I turned off VPN app, other dependencies downloading as expected.

Gradle wrapper:

Is it possible to resolve the “Connection timed out” while connecting to VPN ? Is there any other changes to need to be done in my settings ?

Thanks in advance.