net.i2p.util
Class SSLEepGet
java.lang.Object
net.i2p.util.EepGet
net.i2p.util.SSLEepGet
public class SSLEepGet
- extends EepGet
HTTPS only, non-proxied only, no retries, no min and max size options, no timeout option
Fails on 301 or 302 (doesn't follow redirect)
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/ and ~/.i2p/certificates/
- Since:
- 0.7.10
- Author:
- zzz
Nested Class Summary |
static class |
SSLEepGet.SSLState
An opaque class for the caller to pass to repeated instantiations of SSLEepGet. |
Fields inherited from class net.i2p.util.EepGet |
_aborted, _actualURL, _alreadyTransferred, _bytesRemaining, _bytesTransferred, _contentType, _context, _currentAttempt, _decompressException, _encodingChunked, _etag, _extraHeaders, _fetchInactivityTimeout, _headersRead, _isGzippedResponse, _keepFetching, _lastModified, _listeners, _log, _notModified, _numRetries, _out, _outputFile, _outputStream, _proxy, _proxyIn, _proxyOut, _redirectLocation, _redirects, _responseCode, _shouldProxy, _shouldWriteErrorToOutput, _transferFailed, _url, CONNECT_TIMEOUT, INACTIVITY_TIMEOUT, MAX_COMPLETE_FAILS, USER_AGENT |
Methods inherited from class net.i2p.util.EepGet |
addAuthorization, addHeader, addStatusListener, fetch, fetch, fetch, getContentType, getETag, getLastModified, getNotModified, getRequest, getStatusCode, readChunkLength, readHeaders, setWriteErrorToOutput, stopFetching, suggestName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SSLEepGet
public SSLEepGet(I2PAppContext ctx,
OutputStream outputStream,
String url)
- A new SSLEepGet with a new SSLState
SSLEepGet
public 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
main
public static void main(String[] args)
- SSLEepGet https://foo/bar
or to save cert chain:
SSLEepGet -s https://foo/bar
getSSLState
public 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
doFetch
protected void doFetch(SocketTimeout timeout)
throws IOException
- Description copied from class:
EepGet
- single fetch
- Overrides:
doFetch
in class EepGet
- Parameters:
timeout
- may be null
- Throws:
IOException
sendRequest
protected void sendRequest(SocketTimeout timeout)
throws IOException
- Overrides:
sendRequest
in class EepGet
- Parameters:
timeout
- may be null
- Throws:
IOException