forked from I2P_Developers/i2p.i2p
SSLEepGet: Move all certificates to certificates/ssl, in preparation
for other certificate uses by SU3File
This commit is contained in:
@ -72,7 +72,7 @@ import net.i2p.data.DataHelper;
|
|||||||
* Fails on bad certs (must have a valid cert chain)
|
* Fails on bad certs (must have a valid cert chain)
|
||||||
* Self-signed certs or CAs not in the JVM key store must be loaded to be trusted.
|
* Self-signed certs or CAs not in the JVM key store must be loaded to be trusted.
|
||||||
*
|
*
|
||||||
* Since 0.8.2, loads additional trusted CA certs from $I2P/certificates/ and ~/.i2p/certificates/
|
* Since 0.8.2, loads additional trusted CA certs from $I2P/certificates/ssl/ and ~/.i2p/certificates/ssl/
|
||||||
*
|
*
|
||||||
* @author zzz
|
* @author zzz
|
||||||
* @since 0.7.10
|
* @since 0.7.10
|
||||||
@ -87,6 +87,8 @@ public class SSLEepGet extends EepGet {
|
|||||||
/** may be null if init failed */
|
/** may be null if init failed */
|
||||||
private SavingTrustManager _stm;
|
private SavingTrustManager _stm;
|
||||||
|
|
||||||
|
private static final String CERT_DIR = "certificates/ssl";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A new SSLEepGet with a new SSLState
|
* A new SSLEepGet with a new SSLState
|
||||||
*/
|
*/
|
||||||
@ -171,8 +173,8 @@ public class SSLEepGet extends EepGet {
|
|||||||
* else from $JAVA_HOME/lib/security/jssacacerts,
|
* else from $JAVA_HOME/lib/security/jssacacerts,
|
||||||
* else from $JAVA_HOME/lib/security/cacerts.
|
* else from $JAVA_HOME/lib/security/cacerts.
|
||||||
*
|
*
|
||||||
* Then adds certs found in the $I2P/certificates/ directory
|
* Then adds certs found in the $I2P/certificates/ssl/ directory
|
||||||
* and in the ~/.i2p/certificates/ directory.
|
* and in the ~/.i2p/certificates/ssl/ directory.
|
||||||
*
|
*
|
||||||
* @return null on failure
|
* @return null on failure
|
||||||
* @since 0.8.2
|
* @since 0.8.2
|
||||||
@ -188,13 +190,13 @@ public class SSLEepGet extends EepGet {
|
|||||||
_log.info("Loaded " + count + " default trusted certificates");
|
_log.info("Loaded " + count + " default trusted certificates");
|
||||||
}
|
}
|
||||||
|
|
||||||
File dir = new File(_context.getBaseDir(), "certificates");
|
File dir = new File(_context.getBaseDir(), CERT_DIR);
|
||||||
int adds = KeyStoreUtil.addCerts(dir, ks);
|
int adds = KeyStoreUtil.addCerts(dir, ks);
|
||||||
int totalAdds = adds;
|
int totalAdds = adds;
|
||||||
if (adds > 0 && _log.shouldLog(Log.INFO))
|
if (adds > 0 && _log.shouldLog(Log.INFO))
|
||||||
_log.info("Loaded " + adds + " trusted certificates from " + dir.getAbsolutePath());
|
_log.info("Loaded " + adds + " trusted certificates from " + dir.getAbsolutePath());
|
||||||
if (!_context.getBaseDir().getAbsolutePath().equals(_context.getConfigDir().getAbsolutePath())) {
|
if (!_context.getBaseDir().getAbsolutePath().equals(_context.getConfigDir().getAbsolutePath())) {
|
||||||
dir = new File(_context.getConfigDir(), "certificates");
|
dir = new File(_context.getConfigDir(), CERT_DIR);
|
||||||
adds = KeyStoreUtil.addCerts(dir, ks);
|
adds = KeyStoreUtil.addCerts(dir, ks);
|
||||||
totalAdds += adds;
|
totalAdds += adds;
|
||||||
if (adds > 0 && _log.shouldLog(Log.INFO))
|
if (adds > 0 && _log.shouldLog(Log.INFO))
|
||||||
@ -202,7 +204,7 @@ public class SSLEepGet extends EepGet {
|
|||||||
}
|
}
|
||||||
dir = new File(System.getProperty("user.dir"));
|
dir = new File(System.getProperty("user.dir"));
|
||||||
if (!_context.getBaseDir().getAbsolutePath().equals(dir.getAbsolutePath())) {
|
if (!_context.getBaseDir().getAbsolutePath().equals(dir.getAbsolutePath())) {
|
||||||
dir = new File(_context.getConfigDir(), "certificates");
|
dir = new File(_context.getConfigDir(), CERT_DIR);
|
||||||
adds = KeyStoreUtil.addCerts(dir, ks);
|
adds = KeyStoreUtil.addCerts(dir, ks);
|
||||||
totalAdds += adds;
|
totalAdds += adds;
|
||||||
if (adds > 0 && _log.shouldLog(Log.INFO))
|
if (adds > 0 && _log.shouldLog(Log.INFO))
|
||||||
|
@ -68,3 +68,15 @@ docs/initialNews/initialNews_nl.xml
|
|||||||
docs/initialNews/initialNews_pt.xml
|
docs/initialNews/initialNews_pt.xml
|
||||||
docs/initialNews/initialNews_ru.xml
|
docs/initialNews/initialNews_ru.xml
|
||||||
docs/initialNews/initialNews_sv.xml
|
docs/initialNews/initialNews_sv.xml
|
||||||
|
# certificates moved to certificates/ssl
|
||||||
|
certificates/193.150.121.66.crt
|
||||||
|
certificates/cert.smartcom.org.crt
|
||||||
|
certificates/i2p.feared.eu.crt
|
||||||
|
certificates/i2p.mooo.com.crt
|
||||||
|
certificates/i2pprojekt.de.cert
|
||||||
|
certificates/ieb9oopo.mooo.com.crt
|
||||||
|
certificates/netdb.i2p2.de.crt
|
||||||
|
certificates/netdb.i2p2.no.crt
|
||||||
|
certificates/reseed.info.crt
|
||||||
|
certificates/reseed.pkol.de.crt
|
||||||
|
certificates/www.cacert.org.crt
|
||||||
|
@ -152,7 +152,7 @@ elif [ $(which certtool) ]; then : ;else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd `dirname $0`/../../installer/resources/certificates
|
cd `dirname $0`/../../installer/resources/certificates/ssl
|
||||||
|
|
||||||
for i in *.crt *.cert
|
for i in *.crt *.cert
|
||||||
do
|
do
|
||||||
|
Reference in New Issue
Block a user