mirror of
https://github.com/Benjamin-Wiegand/Flywheel.git
synced 2026-08-07 14:22:23 -07:00
fix: log encoded certificate
the certificate chain fails to log very often
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package io.benwiegand.projection.geargrinder.crypto;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.util.Base64;
|
||||
import android.util.Log;
|
||||
|
||||
import java.security.cert.CertificateEncodingException;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.Arrays;
|
||||
|
||||
@@ -18,6 +20,14 @@ public class LGTMTrustManager implements X509TrustManager {
|
||||
} catch (Throwable t) {
|
||||
Log.e(TAG, "explosions while logging cert chain", t);
|
||||
}
|
||||
|
||||
for (X509Certificate certificate : chain) {
|
||||
try {
|
||||
Log.i(TAG, "cert: " + Base64.encodeToString(certificate.getEncoded(), 0));
|
||||
} catch (CertificateEncodingException e) {
|
||||
Log.e(TAG, "failed to log encoded certificate", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user