diff options
author | Björn Hagemeister | 2014-11-12 15:40:38 +0100 |
---|---|---|
committer | Björn Hagemeister | 2014-11-12 15:40:38 +0100 |
commit | 2600a97e18e300f19ff015feb04e0b9981c5faac (patch) | |
tree | 057d110fd8b2e3cc61ccc1897724fb2c5a978a76 /src | |
parent | Moved proxy configuration file to /opt/openslx/proxy/config and adapted class... (diff) | |
download | satellite-daemon-2600a97e18e300f19ff015feb04e0b9981c5faac.tar.gz satellite-daemon-2600a97e18e300f19ff015feb04e0b9981c5faac.tar.xz satellite-daemon-2600a97e18e300f19ff015feb04e0b9981c5faac.zip |
Adapted to moved whole proxy settings configuration to master-sync-shared.
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/openslx/satellitedaemon/App.java | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/src/main/java/org/openslx/satellitedaemon/App.java b/src/main/java/org/openslx/satellitedaemon/App.java index cf99ba0..55e3149 100644 --- a/src/main/java/org/openslx/satellitedaemon/App.java +++ b/src/main/java/org/openslx/satellitedaemon/App.java @@ -12,6 +12,7 @@ import java.security.interfaces.RSAPublicKey; import org.apache.log4j.BasicConfigurator; import org.apache.log4j.Logger; import org.openslx.network.ProxyConfiguration; +import org.openslx.network.ProxyProperties; import org.openslx.network.StaticProxyAuthenticator; import org.openslx.network.StaticProxySelector; import org.openslx.satellitedaemon.filetransfer.FileDownloadWorker; @@ -123,42 +124,7 @@ public class App } log.info( "Configure proxy settings ..." ); - // Configuring proxy settings. First read options from config file. - String proxyConfiguration = ProxyConfiguration.getProxyConf(); - if ( ( proxyConfiguration.equals( "AUTO" ) ) || ( proxyConfiguration.equals( "" ) ) ) { - log.info( "Configuring proxy settings automatically..." ); - // Configuring proxy settings automatically. - WpadProxySearchStrategy wPSS = new WpadProxySearchStrategy(); - try { - ProxySelector pS = wPSS.getProxySelector(); - ProxySelector.setDefault( pS ); - } catch ( ProxyException e ) { - log.error( "Setting proxy configuration automatically failed.", e ); - } - } else if ( proxyConfiguration.equals( "YES" ) ) { - // Take the proxy settings from config file. - // First check if one of the following necessary options might not be set. - if ( ProxyConfiguration.checkProxySettings() ) { - String proxyAddress = ProxyConfiguration.getProxyAddress(); - int proxyPort = ProxyConfiguration.getProxyPort(); - - // Configure proxy. - Proxy proxy = new Proxy( Proxy.Type.SOCKS, new InetSocketAddress( proxyAddress, proxyPort ) ); - StaticProxySelector sPS = new StaticProxySelector( proxy ); - ProxySelector.setDefault( sPS ); - - if ( ! ( ProxyConfiguration.getProxyUsername().equals( "" ) ) && ! ( ProxyConfiguration.getProxyPassword().equals( "" ) ) ) { - log.info( "Configuring proxy settings manually WITH authentication..." ); - // use Proxy with authentication. - String proxyUname = ProxyConfiguration.getProxyUsername(); - String proxyPass = ProxyConfiguration.getProxyPassword(); - - // Set authentication. - StaticProxyAuthenticator sPA = new StaticProxyAuthenticator( proxyUname, proxyPass ); - Authenticator.setDefault( sPA ); - } - } - } + ProxyConfiguration.configProxy(); log.info( "... proxy settings are done." ); // Start Up- and Download. |