Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.3.6, 1.3.7, 2.0-M1, 2.0-M2
-
Fix Version/s: 2.3-M2
-
Component/s: None
-
Labels:None
-
Environment:Windows XP, proxy required, proxy authentication required
Description
Firstly, when proxy settings are specified using add-proxy, the details do not appear to be appropriate escaped in the generated Groovy script (~/.grails/ProxyConfig.groovy or something like that). This particularly affects users who specify a domain as part of the proxy user name, such as DOMAIN\User10. In this example, the backslash is not escaped, so in the generated configuration file has a syntax error. I believe all of the settings being set should be correctly escaped.
Secondly, in my work environment, even when the configuration file was modified to be syntactically correct again, all Internet connections initiated by Grails through the proxy appeared to time out and fail. These same connections worked flawlessly when made through another correctly configured program. The solution to this problem was found here: http://grails.1312388.n4.nabble.com/Solution-to-Grails-Proxy-Issue-for-installing-plugins-on-windows-td2994191.html
The solution was found in the last step, which advises users to use the following code:
grails.project.dependency.resolution = {
System.setProperty("http.proxyHost", "host");
System.setProperty("http.proxyPort", "port");
Authenticator.setDefault(new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication("username","password".toCharArray());
}});
When the code in the proxy settings Groovy script was replaced with this code instead, Grails' Internet connectivity through the proxy worked flawlessly.
I don't know what caused the problem, but I know for certain that this solution worked. I have marked this as critical, because it appears that many others still have problems with Grails proxy settings, and in environments where a proxy is required, it is critical that this works, particularly when plugins are needed, since Grails is currently highly dependent on functional Internet access for plugin download and dependency resolution.
Also, it would be nice if Grails would use the computer's system-wide proxy settings by default rather than users having to re-enter them in the application.