mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-27 19:35:10 +01:00
Improved DANE error message
This commit is contained in:
@@ -368,9 +368,12 @@ public class DnsHelper {
|
||||
if (!hasDnsSec())
|
||||
return;
|
||||
|
||||
List<String> log = new ArrayList<>();
|
||||
|
||||
Handler handler = new Handler() {
|
||||
@Override
|
||||
public void publish(LogRecord record) {
|
||||
log.add(record.getMessage());
|
||||
Log.w("DANE " + record.getMessage());
|
||||
}
|
||||
|
||||
@@ -390,7 +393,8 @@ public class DnsHelper {
|
||||
boolean verified = new DaneVerifier().verifyCertificateChain(chain, server, port);
|
||||
Log.w("DANE verified=" + verified + " " + server + ":" + port);
|
||||
if (!verified)
|
||||
throw new CertificateException("DANE missing or invalid");
|
||||
throw new CertificateException("DANE missing or invalid",
|
||||
new CertificateException(TextUtils.join("\n", log)));
|
||||
} catch (CertificateException ex) {
|
||||
throw ex;
|
||||
} catch (Throwable ex) {
|
||||
|
||||
Reference in New Issue
Block a user