Changeset 9eec357


Ignore:
Timestamp:
May 11, 2019 1:37:18 PM (19 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
adb1c6f
Parents:
f6efdcea
Message:

Utils: Allow absolute path to certs in I2PSSLSocketFactory

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/util/I2PSSLSocketFactory.java

    rf6efdcea r9eec357  
    238238
    239239    /**
    240      * @param relativeCertPath e.g. "certificates/i2cp"
     240     * @param relativeCertPath e.g. "certificates/i2cp"; as of 0.9.41, may be absolute
    241241     * @since 0.9.9 was static
    242242     */
     
    469469    /**
    470470     *  Loads certs from
    471      *  the ~/.i2p/certificates/ and $I2P/certificates/ directories.
     471     *  the ~/.i2p/certificates/ and $I2P/certificates/ directories,
     472     *  or from the absolute path given.
     473     *
     474     *  @param relativeCertPath e.g. "certificates/i2cp"; as of 0.9.41, may be absolute
    472475     */
    473476    private static SSLSocketFactory initSSLContext(I2PAppContext context, boolean loadSystemCerts, String relativeCertPath)
     
    488491        }
    489492
    490         File dir = new File(context.getConfigDir(), relativeCertPath);
     493        File dir = new File(relativeCertPath);
     494        boolean wasAbsolute = dir.isAbsolute();
     495        if (!wasAbsolute)
     496            dir = new File(context.getConfigDir(), relativeCertPath);
    491497        int adds = KeyStoreUtil.addCerts(dir, ks);
    492498        int totalAdds = adds;
     
    496502        }
    497503
    498         File dir2 = new File(context.getBaseDir(), relativeCertPath);
    499         if (!dir.getAbsolutePath().equals(dir2.getAbsolutePath())) {
    500             adds = KeyStoreUtil.addCerts(dir2, ks);
    501             totalAdds += adds;
    502             if (adds > 0) {
    503                 if (log.shouldLog(Log.INFO))
    504                     log.info("Loaded " + adds + " trusted certificates from " + dir.getAbsolutePath());
     504        File dir2;
     505        if (!wasAbsolute) {
     506            dir2 = new File(context.getBaseDir(), relativeCertPath);
     507            if (!dir.getAbsolutePath().equals(dir2.getAbsolutePath())) {
     508                adds = KeyStoreUtil.addCerts(dir2, ks);
     509                totalAdds += adds;
     510                if (adds > 0) {
     511                    if (log.shouldLog(Log.INFO))
     512                        log.info("Loaded " + adds + " trusted certificates from " + dir.getAbsolutePath());
     513                }
    505514            }
     515        } else {
     516            // for logging below
     517            dir2 = dir;
    506518        }
    507519        if (totalAdds > 0 || loadSystemCerts) {
  • history.txt

    rf6efdcea r9eec357  
     12019-05-11 zzz
     2 * Utils: Allow absolute path to certs in I2PSSLSocketFactory
     3
     42019-05-10 zzz
     5 * NetDB: Store Meta LS2 to floodfills (proposal #123)
     6
     72019-05-09 zzz
     8 * Console:
     9   - Delay plugin update check until router is ready
     10   - Remove plugin install success message (ticket #2494)
     11 * Transport: Start first GeoIP lookup when netdb is ready
     12 * Wrapper:
     13   - Add support for armv7 and aarch64 (ticket #2308)
     14   - Update to 3.5.39
     15
     162019-05-08 zzz
     17 * Utils: Auto-generate su3 output file for extract if not specified
     18
    119* 2019-05-07 0.9.40 released
    220
  • router/java/src/net/i2p/router/RouterVersion.java

    rf6efdcea r9eec357  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 1;
     21    public final static long BUILD = 2;
    2222
    2323    /** for example "-test" */
Note: See TracChangeset for help on using the changeset viewer.