I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit e293b25b authored by zzz's avatar zzz
Browse files

I2CP username/pw auth (client side)

parent 23005a82
No related branches found
No related tags found
No related merge requests found
......@@ -164,8 +164,8 @@ abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2CPMessa
}
/**
* Parse the config for anything we know about
*
* Parse the config for anything we know about.
* Also fill in the authorization properties if missing.
*/
protected void loadConfig(Properties options) {
_options = new Properties();
......@@ -180,6 +180,18 @@ abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2CPMessa
+ LISTEN_PORT, nfe);
_portNum = LISTEN_PORT;
}
// auto-add auth if required, not set in the options, and we are in the same JVM
if (_context.isRouterContext() &&
Boolean.valueOf(_context.getProperty("i2cp.auth")).booleanValue() &&
((!options.containsKey("i2cp.username")) || (!options.containsKey("i2cp.password")))) {
String configUser = _context.getProperty("i2cp.username");
String configPW = _context.getProperty("i2cp.password");
if (configUser != null && configPW != null) {
_options.setProperty("i2cp.username", configUser);
_options.setProperty("i2cp.password", configPW);
}
}
}
private Properties filter(Properties options) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment