forked from I2P_Developers/i2p.i2p
reseed tweaks for SNI
This commit is contained in:
@@ -37,6 +37,7 @@ import net.i2p.util.Log;
|
||||
import net.i2p.util.SecureDirectory;
|
||||
import net.i2p.util.SecureFileOutputStream;
|
||||
import net.i2p.util.SSLEepGet;
|
||||
import net.i2p.util.SystemVersion;
|
||||
import net.i2p.util.Translate;
|
||||
|
||||
/**
|
||||
@@ -91,10 +92,11 @@ public class Reseeder {
|
||||
public static final String DEFAULT_SSL_SEED_URL =
|
||||
"https://reseed.i2p-projekt.de/" + "," + // Only HTTPS
|
||||
"https://netdb.rows.io:444/" + "," + // Only HTTPS and SU3 (v3) support
|
||||
"https://i2pseed.zarrenspry.info/" + "," + // Only HTTPS and SU3 (v3) support
|
||||
// temp disabled until SNI supported or cert changed
|
||||
//"https://i2pseed.zarrenspry.info/" + "," + // Only HTTPS and SU3 (v3) support
|
||||
"https://i2p.mooo.com/netDb/" + "," +
|
||||
"https://193.150.121.66/netDb/" + "," +
|
||||
"https://netdb.i2p2.no/" + "," + // Only SU3 (v3) support
|
||||
"https://netdb.i2p2.no/" + "," + // Only SU3 (v3) support, SNI required
|
||||
"https://us.reseed.i2p2.no:444/" + "," +
|
||||
"https://uk.reseed.i2p2.no:444/" + "," +
|
||||
// Down (ticket #1422)
|
||||
@@ -222,6 +224,16 @@ public class Reseeder {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Since Java 7 or Android 2.3 (API 9),
|
||||
* which is the lowest Android we support anyway.
|
||||
*
|
||||
* @since 0.9.20
|
||||
*/
|
||||
private static boolean isSNISupported() {
|
||||
return SystemVersion.isJava7() || SystemVersion.isAndroid();
|
||||
}
|
||||
|
||||
private class ReseedRunner implements Runnable, EepGet.StatusListener {
|
||||
private boolean _isRunning;
|
||||
private String _proxyHost;
|
||||
@@ -473,6 +485,11 @@ public class Reseeder {
|
||||
URLList.addAll(nonSSLList);
|
||||
}
|
||||
}
|
||||
if (!isSNISupported()) {
|
||||
try {
|
||||
URLList.remove(new URL("https://netdb.i2p2.no/"));
|
||||
} catch (MalformedURLException mue) {}
|
||||
}
|
||||
if (URLList.isEmpty()) {
|
||||
System.out.println("No valid reseed URLs");
|
||||
_checker.setError("No valid reseed URLs");
|
||||
|
Reference in New Issue
Block a user