Enable proxy authentication type to be configured

This commit is contained in:
str4d
2015-03-11 23:46:38 +00:00
parent b8b272a5b8
commit 0b6f74e646
2 changed files with 23 additions and 9 deletions

View File

@@ -334,10 +334,15 @@ public class TunnelConfig {
_booleanOptions.remove("shouldBundleReplyInfo");
}
/** all proxy auth */
public void setProxyAuth(String s) {
if (s != null)
_otherOptions.put(I2PTunnelHTTPClientBase.PROP_AUTH, I2PTunnelHTTPClientBase.DIGEST_AUTH);
/**
* Sets whether authentication should be used for client proxy tunnels.
* Supported authentication types: "basic", "digest".
*
* @param authType the authentication type, or "false" for no authentication
*/
public void setProxyAuth(String authType) {
if (authType != null)
_otherOptions.put(I2PTunnelHTTPClientBase.PROP_AUTH, authType.trim());
}
public void setProxyUsername(String s) {
@@ -350,8 +355,16 @@ public class TunnelConfig {
_newProxyPW = s.trim();
}
public void setOutproxyAuth(String s) {
_otherOptions.put(I2PTunnelHTTPClientBase.PROP_OUTPROXY_AUTH, I2PTunnelHTTPClientBase.DIGEST_AUTH);
/**
* Sets the authentication type required for configured outproxies. The
* same authentication type is assumed for all configured outproxies.
* Supported authentication types: "basic", "digest".
*
* @param authType the authentication type, or "false" for no authentication
*/
public void setOutproxyAuth(String authType) {
if (authType != null)
_otherOptions.put(I2PTunnelHTTPClientBase.PROP_OUTPROXY_AUTH, authType.trim());
}
public void setOutproxyUsername(String s) {
@@ -440,7 +453,7 @@ public class TunnelConfig {
public void setSigType(String val) {
if (val != null)
_otherOptions.put(I2PClient.PROP_SIGTYPE, val);
_otherOptions.put(I2PClient.PROP_SIGTYPE, val.trim());
}
/**

View File

@@ -25,6 +25,7 @@ import net.i2p.data.PrivateKeyFile;
import net.i2p.data.SessionKey;
import net.i2p.i2ptunnel.I2PTunnelClientBase;
import net.i2p.i2ptunnel.I2PTunnelHTTPClient;
import net.i2p.i2ptunnel.I2PTunnelHTTPClientBase;
import net.i2p.i2ptunnel.I2PTunnelHTTPServer;
import net.i2p.i2ptunnel.I2PTunnelServer;
import net.i2p.i2ptunnel.SSLClientUtil;
@@ -943,7 +944,7 @@ public class IndexBean {
/** all proxy auth @since 0.8.2 */
public void setProxyAuth(String s) {
_config.setProxyAuth(s);
_config.setProxyAuth(I2PTunnelHTTPClientBase.DIGEST_AUTH);
}
public void setProxyUsername(String s) {
@@ -955,7 +956,7 @@ public class IndexBean {
}
public void setOutproxyAuth(String s) {
_config.setOutproxyAuth(s);
_config.setOutproxyAuth(I2PTunnelHTTPClientBase.DIGEST_AUTH);
}
public void setOutproxyUsername(String s) {