Changeset ea9a332 for core


Ignore:
Timestamp:
Apr 17, 2018 5:16:51 PM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
75c20c9
Parents:
d621e19
Message:

DNSoverHTTPS for SSLEepGet and NTP (ticket #2201)

Location:
core/java/src/net/i2p/util
Files:
1 added
3 edited

Legend:

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

    rd621e19 rea9a332  
    3333        "net.i2p.util.Addresses",
    3434        "net.i2p.util.ConvertToHash",
     35        "net.i2p.util.DNSOverHTTPS",
    3536        "net.i2p.util.EepGet",
    3637        "net.i2p.util.EepHead",
  • core/java/src/net/i2p/util/ObjectCounter.java

    rd621e19 rea9a332  
    5252
    5353    /**
    54      *  start over
     54     *  Start over. Reset the count for all keys to zero.
    5555     *  @since 0.7.11
    5656     */
     
    5858        this.map.clear();
    5959    }
     60
     61    /**
     62     *  Reset the count for this key to zero
     63     *  @since 0.9.36
     64     */
     65    public void clear(K h) {
     66        this.map.remove(h);
     67    }
    6068}
    6169
  • core/java/src/net/i2p/util/SSLEepGet.java

    rd621e19 rea9a332  
    102102
    103103    private static final String CERT_DIR = "certificates/ssl";
     104    private static final String PROP_USE_DNS_OVER_HTTPS = "eepget.useDNSOverHTTPS";
     105    private static final boolean DEFAULT_USE_DNS_OVER_HTTPS = true;
    104106
    105107    /**
     
    707709                    port = 443;
    708710
     711                String originalHost = host;
     712                boolean useDNSOverHTTPS = _context.getProperty(PROP_USE_DNS_OVER_HTTPS, DEFAULT_USE_DNS_OVER_HTTPS);
     713                // This duplicates checks in DNSOverHTTPS.lookup() but do it here too so
     714                // we don't even construct it if we don't need it
     715                if (useDNSOverHTTPS && !host.equals("dns.google.com") && !Addresses.isIPAddress(host)) {
     716                    DNSOverHTTPS doh = new DNSOverHTTPS(_context, getSSLState());
     717                    String ip = doh.lookup(host);
     718                    if (ip != null)
     719                        host = ip;
     720                }
     721
    709722                if (_shouldProxy) {
    710723                    if (_log.shouldLog(Log.DEBUG))
     
    758771                if (!_bypassVerification) {
    759772                    try {
    760                         I2PSSLSocketFactory.verifyHostname(_context, socket, host);
     773                        I2PSSLSocketFactory.verifyHostname(_context, socket, originalHost);
    761774                    } catch (SSLException ssle) {
    762775                        if (_saveCerts > 0 && _stm != null)
Note: See TracChangeset for help on using the changeset viewer.