I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 3fe092d7 authored by zzz's avatar zzz
Browse files

tab cleanup

parent e2fe5004
No related branches found
No related tags found
No related merge requests found
...@@ -253,7 +253,7 @@ public class SSLEepGet extends EepGet { ...@@ -253,7 +253,7 @@ public class SSLEepGet extends EepGet {
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
tmf.init(ks); tmf.init(ks);
X509TrustManager defaultTrustManager = (X509TrustManager)tmf.getTrustManagers()[0]; X509TrustManager defaultTrustManager = (X509TrustManager)tmf.getTrustManagers()[0];
_stm = new SavingTrustManager(defaultTrustManager); _stm = new SavingTrustManager(defaultTrustManager);
sslc.init(null, new TrustManager[] {_stm}, null); sslc.init(null, new TrustManager[] {_stm}, null);
return sslc; return sslc;
} catch (GeneralSecurityException gse) { } catch (GeneralSecurityException gse) {
...@@ -380,27 +380,27 @@ public class SSLEepGet extends EepGet { ...@@ -380,27 +380,27 @@ public class SSLEepGet extends EepGet {
* @since 0.8.2 * @since 0.8.2
*/ */
private static class SavingTrustManager implements X509TrustManager { private static class SavingTrustManager implements X509TrustManager {
private final X509TrustManager tm; private final X509TrustManager tm;
private X509Certificate[] chain; private X509Certificate[] chain;
SavingTrustManager(X509TrustManager tm) { SavingTrustManager(X509TrustManager tm) {
this.tm = tm; this.tm = tm;
} }
public X509Certificate[] getAcceptedIssuers() { public X509Certificate[] getAcceptedIssuers() {
return new X509Certificate[0]; return new X509Certificate[0];
} }
public void checkClientTrusted(X509Certificate[] chain, String authType) public void checkClientTrusted(X509Certificate[] chain, String authType)
throws CertificateException { throws CertificateException {
throw new CertificateException(); throw new CertificateException();
} }
public void checkServerTrusted(X509Certificate[] chain, String authType) public void checkServerTrusted(X509Certificate[] chain, String authType)
throws CertificateException { throws CertificateException {
this.chain = chain; this.chain = chain;
tm.checkServerTrusted(chain, authType); tm.checkServerTrusted(chain, authType);
} }
} }
/** /**
...@@ -412,7 +412,7 @@ public class SSLEepGet extends EepGet { ...@@ -412,7 +412,7 @@ public class SSLEepGet extends EepGet {
if (chain == null) { if (chain == null) {
System.out.println("Could not obtain server certificate chain"); System.out.println("Could not obtain server certificate chain");
return; return;
} }
for (int k = 0; k < chain.length; k++) { for (int k = 0; k < chain.length; k++) {
X509Certificate cert = chain[k]; X509Certificate cert = chain[k];
String name = host + '-' + (k + 1) + ".crt"; String name = host + '-' + (k + 1) + ".crt";
...@@ -468,7 +468,7 @@ public class SSLEepGet extends EepGet { ...@@ -468,7 +468,7 @@ public class SSLEepGet extends EepGet {
* @since 0.8.2 * @since 0.8.2
*/ */
public static class SSLState { public static class SSLState {
private SSLContext context; private final SSLContext context;
private SSLState(SSLContext ctx) { private SSLState(SSLContext ctx) {
context = ctx; context = ctx;
...@@ -627,7 +627,7 @@ public class SSLEepGet extends EepGet { ...@@ -627,7 +627,7 @@ public class SSLEepGet extends EepGet {
// for which we cannot easily determine how much we've written. // for which we cannot easily determine how much we've written.
// Assume that _alreadyTransferred holds the right value // Assume that _alreadyTransferred holds the right value
// (we should never be restarted to work on an old stream). // (we should never be restarted to work on an old stream).
} else { } else {
File outFile = new File(_outputFile); File outFile = new File(_outputFile);
if (outFile.exists()) if (outFile.exists())
_alreadyTransferred = outFile.length(); _alreadyTransferred = outFile.length();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment