Page 1 of 1

Proxy wont allow license validation

Posted: 15 Jun 2016, 12:41
by Jay Freeman
I am running madsonic at work, but the network I am on is behind a proxy. I am unable to validate my license, and see the following error in the logs:

Code: Select all

[2016-06-15 12:30:53,623] WARN SettingsService - Failed to validate license.
org.apache.http.conn.HttpHostConnectException: Connect to beta.madsonic.org:80 [beta.madsonic.org/52.1.190.210] failed: Connection timed out: connect
If I switch to another less secure network that does not have the proxy, then I don't see this error and I am able to validate my license. However this is not an ideal solution, I need to be on the secure network.

Is there another workaround?

Thanks

Re: Proxy wont allow license validation

Posted: 15 Jun 2016, 16:59
by Jay Freeman
I have tried setting the following in the vmoptions file

Code: Select all

-Dhttp.proxyHost=......
-Dhttp.proxyPort=......
-Dhttp.nonProxyHosts="localhost|127.0.0.1"
I've also set them as environment variables (JAVA_OPTS) and in the java control panel, still no joy. I had a quick look at the source to communicate with the madsonic server and the class isn't proxying anything.

Nor does this work

Code: Select all

java -DproxySet=true -DproxyHost=..... -DproxyPort=..... -jar madsonic-booter.jar

Re: Proxy wont allow license validation

Posted: 16 Jun 2016, 12:05
by Jay Freeman
A quick test in SettingsService.java

Code: Select all

public void validateLicense() {
// code snipped
HttpHost proxy = new HttpHost(proxyServer, proxyPort, "http");
	        RequestConfig requestConfig = RequestConfig.custom()
					.setProxy(proxy)
// code snipped
}

Seems to work for me (made the same change to isLicenseKeyValid() also), my license is validated