Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run Grails Wrapper (grailsw) behind a proxy?

Tags:

proxy

grails

I tried to run grailsw, but the wrapper cannot connect to download grails-2.2.1-download.zip (creates a 0 byte file instead).

I need to use a proxy server to connect to the internet, where do I configure proxy settings for the Grails Wrapper?

like image 684
peterp Avatar asked May 27 '13 11:05

peterp


2 Answers

After running grails wrapper, your project directory has a new subdirectory called wrapper, with a file grails-wrapper.properties. You can configure your proxy settings in there, with the following properties:

systemProp.http.proxyHost=
systemProp.http.proxyPort=
systemProp.http.proxyUser=
systemProp.http.proxyPassword=
systemProp.http.nonProxyHosts=
like image 99
peterp Avatar answered Oct 16 '22 04:10

peterp


I solved this problem for myself. It is a two step process

1.a) Back up your JRE_HOME\lib\security folder. This is essential because the below steps might corrupt cacerts file under jre.

1.b) You need to install the ssl public key of Github.com to your local file system. To do that you have to use the InstallCert.java program( Link to InstallCert.java )

It is supposed to be run as java InstallCert github.com and when it asks to enter cert number you need to enter 1 It will create a file with name "jssecacerts" in the current directory

1.c) But this program will not work because it does not know about how to authenticate with proxy. For this you need the code from SSLSocketClientWithTunneling page

Use the above two and create a program that tunnels through the proxy retrieves the ssl key and writes a file called jssecerts

2) Update your grails.bat with addtional options. Add these options to the %JAVA_EXE% command line. Paste them after %DEFAULT_JVM_OPTS%

-Dhttp.proxyHost=YourproxyURL -Dhttp.proxyPort=YourproxyPort -Dhttps.proxyHost=YourproxyURL -Dhttps.proxyPort=YourproxyPort -Dhttp.proxyUser=YourProxyUserID -Dhttp.proxyPassword=YourProxyPassword -Dhttps.proxyUser=YourProxyUserID -Dhttps.proxyPassword=YourProxyPassword -Djavax.net.ssl.trustStore=path-to-your-jssecacerts-created-in-step-1

like image 28
Jaya Nandan Avatar answered Oct 16 '22 05:10

Jaya Nandan