google / tsunami-security-scanner

Tsunami is a general purpose network security scanner with an extensible plugin system for detecting high severity vulnerabilities with high confidence.
Apache License 2.0
8.2k stars 881 forks source link

Installer and Docker builds fail as they do not support proxy servers #103

Open huornlmj opened 1 year ago

huornlmj commented 1 year ago

Installation fails with the following when the system is located behind a proxy.

Exception in thread "main" java.io.IOException: Downloading from https://services.gradle.org/distributions/gradle-6.5-bin.zip failed: timeout

Same happens in both installation modes (traditional and Docker build)

Please provide a way to install behind a proxy.

--SNIP--
Building all Google plugins ...

Building detectors/credentials/cve20177615 ...
Downloading https://services.gradle.org/distributions/gradle-6.5-bin.zip

Exception in thread "main" java.io.IOException: Downloading from https://services.gradle.org/distributions/gradle-6.5-bin.zip failed: timeout
        at org.gradle.wrapper.Download.downloadInternal(Download.java:106)
        at org.gradle.wrapper.Download.download(Download.java:66)
        at org.gradle.wrapper.Install$1.call(Install.java:68)
        at org.gradle.wrapper.Install$1.call(Install.java:48)
        at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
        at org.gradle.wrapper.Install.createDist(Install.java:48)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:63)
Caused by: java.net.SocketTimeoutException: Connect timed out
        at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:539)
        at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:585)
        at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
        at java.base/java.net.Socket.connect(Socket.java:666)
        at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304)
        at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:178)
        at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:531)
        at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:636)
        at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
        at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:378)
        at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1241)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1127)
        at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1661)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1585)
        at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
        at org.gradle.wrapper.Download.downloadInternal(Download.java:83)
        ... 7 more
RiRa12621 commented 8 months ago

But that seems to be an issue on your end, does a plain wget https://services.gradle.org/distributions/gradle-6.5-bin.zip work?

huornlmj commented 8 months ago

Yes a wget works.

tooryx commented 8 months ago

Hi @huornlmj,

Just to clarify, how is the proxy configured on your host? Is it a transparent proxy or is it declared via system-wide settings? I have limited knowledge of gradle but I am pretty sure we could find a way to define the proxy.

~tooryx

huornlmj commented 8 months ago

It's via environment variables (http_proxy and https_proxy).

tooryx commented 8 months ago

Could you try setting the proxy configuration in gradle.properties as instructed in https://docs.gradle.org/current/userguide/networking.html? When I have a bit more time, I will setup a test environment to try to reproduce this and complete the documentation accordingly.