Cipher debugging

pull/194/merge
M66B 3 years ago
parent 778d661419
commit ebab1f0299

@ -2699,7 +2699,13 @@ public class Log {
static SpannableStringBuilder getCiphers() { static SpannableStringBuilder getCiphers() {
SpannableStringBuilder ssb = new SpannableStringBuilderEx(); SpannableStringBuilder ssb = new SpannableStringBuilderEx();
for (String protocol : new String[]{"SSL", "TLS"})
try { try {
int begin = ssb.length();
ssb.append("Protocol: ").append(protocol);
ssb.setSpan(new StyleSpan(Typeface.BOLD), begin, ssb.length(), 0);
ssb.append("\r\n\r\n");
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
tmf.init((KeyStore) null); tmf.init((KeyStore) null);
@ -2711,7 +2717,7 @@ public class Log {
for (TrustManager tm : tms) for (TrustManager tm : tms)
ssb.append("Manager: ").append(tm.getClass().getName()).append("\r\n"); ssb.append("Manager: ").append(tm.getClass().getName()).append("\r\n");
SSLContext sslContext = SSLContext.getInstance("TLS"); SSLContext sslContext = SSLContext.getInstance(protocol);
ssb.append("Context: ").append(sslContext.getProtocol()).append("\r\n\r\n"); ssb.append("Context: ").append(sslContext.getProtocol()).append("\r\n\r\n");
@ -2723,10 +2729,14 @@ public class Log {
for (String p : socket.getSupportedProtocols()) { for (String p : socket.getSupportedProtocols()) {
boolean enabled = protocols.contains(p); boolean enabled = protocols.contains(p);
if (!enabled)
ssb.append('(');
int start = ssb.length(); int start = ssb.length();
ssb.append(p); ssb.append(p);
if (!enabled) if (!enabled) {
ssb.setSpan(new StrikethroughSpan(), start, ssb.length(), 0); ssb.setSpan(new StrikethroughSpan(), start, ssb.length(), 0);
ssb.append(')');
}
ssb.append("\r\n"); ssb.append("\r\n");
} }
ssb.append("\r\n"); ssb.append("\r\n");

Loading…
Cancel
Save