Package net.i2p.util
Class SSLEepGet
- java.lang.Object
- 
- net.i2p.util.EepGet
- 
- net.i2p.util.SSLEepGet
 
 
- 
 public class SSLEepGet extends EepGet HTTPS only, no retries, no min and max size options, no timeout option As of 0.9.45, supports redirect to https (redirect to http will still fail). 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. Since 0.8.2, loads additional trusted CA certs from $I2P/certificates/ssl/ and ~/.i2p/certificates/ssl/ Since 0.9.33, HTTP proxies (CONNECT) supported. Proxy auth not supported.- Since:
- 0.7.10
- Author:
- zzz
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classSSLEepGet.ProxyTypeNot all may be supported.static classSSLEepGet.SSLStateAn opaque class for the caller to pass to repeated instantiations of SSLEepGet.- 
Nested classes/interfaces inherited from class net.i2p.util.EepGetEepGet.AUTH_MODE, EepGet.AuthState, EepGet.CLIStatusListener, EepGet.Gunzipper, EepGet.StatusListener
 
- 
 - 
Field Summary- 
Fields inherited from class net.i2p.util.EepGet_aborted, _actualURL, _alreadyTransferred, _authState, _bytesRemaining, _bytesTransferred, _contentType, _context, _currentAttempt, _decompressException, _encodingChunked, _etag, _etagOrig, _extraHeaders, _fetchHeaderTimeout, _fetchInactivityTimeout, _fetchTotalTimeout, _isGzippedResponse, _keepFetching, _lastModified, _lastModifiedOrig, _listeners, _log, _notModified, _numRetries, _out, _outputFile, _outputStream, _proxy, _proxyHost, _proxyIn, _proxyOut, _proxyPort, _redirectLocation, _redirects, _responseCode, _responseText, _shouldProxy, _shouldWriteErrorToOutput, _transferFailed, _url, CONNECT_TIMEOUT, INACTIVITY_TIMEOUT, MAX_COMPLETE_FAILS, USER_AGENT
 
- 
 - 
Constructor SummaryConstructors Constructor Description SSLEepGet(I2PAppContext ctx, OutputStream outputStream, String url)A new SSLEepGet with a new SSLStateSSLEepGet(I2PAppContext ctx, OutputStream outputStream, String url, long maxSize, SSLEepGet.SSLState state)SSLEepGet(I2PAppContext ctx, OutputStream outputStream, String url, SSLEepGet.SSLState state)SSLEepGet(I2PAppContext ctx, String outputFile, String url)A new SSLEepGet with a new SSLStateSSLEepGet(I2PAppContext ctx, String outputFile, String url, SSLEepGet.SSLState state)SSLEepGet(I2PAppContext ctx, SSLEepGet.ProxyType type, String proxyHost, int proxyPort, OutputStream outputStream, String url)Use a proxy.SSLEepGet(I2PAppContext ctx, SSLEepGet.ProxyType type, String proxyHost, int proxyPort, OutputStream outputStream, String url, SSLEepGet.SSLState state)Use a proxy.SSLEepGet(I2PAppContext ctx, SSLEepGet.ProxyType type, String proxyHost, int proxyPort, String outputFile, String url)Use a proxy.SSLEepGet(I2PAppContext ctx, SSLEepGet.ProxyType type, String proxyHost, int proxyPort, String outputFile, String url, SSLEepGet.SSLState state)Use a proxy.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoFetch(SocketTimeout timeout)This reads the response to a single fetch.voidforceDNSOverHTTPS(boolean on)Override the config setting, force DNSoverHTTPS on or off Call before the fetch.SSLEepGet.SSLStategetSSLState()Pass this back to the next SSLEepGet constructor for faster fetches.static voidmain(String[] args)SSLEepGet https://foo/bar or to save cert chain: SSLEepGet -s https://foo/barprotected voidsendRequest(SocketTimeout timeout)- 
Methods inherited from class net.i2p.util.EepGetaddAuthorization, addHeader, addStatusListener, fetch, fetch, fetch, getContentType, getETag, getLastModified, getNotModified, getRequest, getStatusCode, getStatusText, parseAuthArgs, readChunkLength, readHeaders, setWriteErrorToOutput, shouldReadBody, stopFetching, suggestName
 
- 
 
- 
- 
- 
Constructor Detail- 
SSLEepGetpublic SSLEepGet(I2PAppContext ctx, OutputStream outputStream, String url) A new SSLEepGet with a new SSLState
 - 
SSLEepGetpublic SSLEepGet(I2PAppContext ctx, OutputStream outputStream, String url, SSLEepGet.SSLState state) - Parameters:
- state- an SSLState retrieved from a previous SSLEepGet with getSSLState(), or null. This makes repeated fetches from the same host MUCH faster, and prevents repeated key store loads even for different hosts.
- Since:
- 0.8.2
 
 - 
SSLEepGetpublic SSLEepGet(I2PAppContext ctx, OutputStream outputStream, String url, long maxSize, SSLEepGet.SSLState state) - Parameters:
- maxSize- The maximum size of the response
- state- an SSLState retrieved from a previous SSLEepGet with getSSLState(), or null. This makes repeated fetches from the same host MUCH faster, and prevents repeated key store loads even for different hosts.
- Since:
- 0.9.48
 
 - 
SSLEepGetpublic SSLEepGet(I2PAppContext ctx, String outputFile, String url) A new SSLEepGet with a new SSLState- Since:
- 0.9.9
 
 - 
SSLEepGetpublic SSLEepGet(I2PAppContext ctx, String outputFile, String url, SSLEepGet.SSLState state) - Parameters:
- state- an SSLState retrieved from a previous SSLEepGet with getSSLState(), or null. This makes repeated fetches from the same host MUCH faster, and prevents repeated key store loads even for different hosts.
- Since:
- 0.9.9
 
 - 
SSLEepGetpublic SSLEepGet(I2PAppContext ctx, SSLEepGet.ProxyType type, String proxyHost, int proxyPort, OutputStream outputStream, String url) Use a proxy.- Parameters:
- proxyHost- Must be valid hostname or literal IPv4/v6. If type is INTERNAL, set to "localhost".
- proxyPort- Must be valid, -1 disallowed, no default. If type is INTERNAL, set to 4444.
- Since:
- 0.9.33
 
 - 
SSLEepGetpublic SSLEepGet(I2PAppContext ctx, SSLEepGet.ProxyType type, String proxyHost, int proxyPort, OutputStream outputStream, String url, SSLEepGet.SSLState state) Use a proxy.- Parameters:
- proxyHost- Must be valid hostname or literal IPv4/v6. If type is INTERNAL, set to "localhost".
- proxyPort- Must be valid, -1 disallowed, no default. If type is INTERNAL, set to 4444.
- state- an SSLState retrieved from a previous SSLEepGet with getSSLState(), or null. This makes repeated fetches from the same host MUCH faster, and prevents repeated key store loads even for different hosts.
- Since:
- 0.9.33
 
 - 
SSLEepGetpublic SSLEepGet(I2PAppContext ctx, SSLEepGet.ProxyType type, String proxyHost, int proxyPort, String outputFile, String url) Use a proxy.- Parameters:
- proxyHost- Must be valid hostname or literal IPv4/v6. If type is INTERNAL, set to "localhost".
- proxyPort- Must be valid, -1 disallowed, no default. If type is INTERNAL, set to 4444.
- Since:
- 0.9.33
 
 - 
SSLEepGetpublic SSLEepGet(I2PAppContext ctx, SSLEepGet.ProxyType type, String proxyHost, int proxyPort, String outputFile, String url, SSLEepGet.SSLState state) Use a proxy.- Parameters:
- proxyHost- Must be valid hostname or literal IPv4/v6. If type is INTERNAL, set to "localhost".
- proxyPort- Must be valid, -1 disallowed, no default. If type is INTERNAL, set to 4444.
- state- an SSLState retrieved from a previous SSLEepGet with getSSLState(), or null. This makes repeated fetches from the same host MUCH faster, and prevents repeated key store loads even for different hosts.
- Since:
- 0.9.33
 
 
- 
 - 
Method Detail- 
mainpublic static void main(String[] args) SSLEepGet https://foo/bar or to save cert chain: SSLEepGet -s https://foo/bar
 - 
getSSLStatepublic SSLEepGet.SSLState getSSLState() Pass this back to the next SSLEepGet constructor for faster fetches. This may be called either after the constructor or after the fetch.- Since:
- 0.8.2
 
 - 
forceDNSOverHTTPSpublic void forceDNSOverHTTPS(boolean on) Override the config setting, force DNSoverHTTPS on or off Call before the fetch.- Since:
- 0.9.49
 
 - 
doFetchprotected void doFetch(SocketTimeout timeout) throws IOException Description copied from class:EepGetThis reads the response to a single fetch. Call after sendRequest()- Overrides:
- doFetchin class- EepGet
- Parameters:
- timeout- may be null
- Throws:
- IOException
 
 - 
sendRequestprotected void sendRequest(SocketTimeout timeout) throws IOException - Overrides:
- sendRequestin class- EepGet
- Parameters:
- timeout- may be null
- Throws:
- IOException
 
 
- 
 
-