Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A simple fix for I2P and Lokinet. #1445

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions libdino/src/service/connection_manager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,18 @@ public class ConnectionManager : Object {
}

public static bool on_invalid_certificate(string domain, TlsCertificate peer_cert, TlsCertificateFlags errors) {
if (domain.has_suffix(".onion") && errors == TlsCertificateFlags.UNKNOWN_CA) {
// It's barely possible for .onion servers to provide a non-self-signed cert.
// But that's fine because encryption is provided independently though TOR.
warning("Accepting TLS certificate from unknown CA from .onion address %s", domain);
return true;
string[] tld_exceptions = {".onion", ".i2p", ".ygg", ".local", ".loki"};
if (errors == TlsCertificateFlags.UNKNOWN_CA) {
foreach (string whitelisted_tld in tld_exceptions) {
if (domain.has_suffix(whitelisted_tld)) {
// It's barely possible for .onion servers to provide a non-self-signed cert.
// But that's fine because encryption is provided independently though Tor.
// Same for .i2p servers on I2P, and .loki servers on Lokinet.
// Although maintaining exceptions for mixnet TLDs could become overwhelming soon.
warning("Accepting TLS certificate from unknown CA from %s address %s", whitelisted_tld, domain);
return true;
}
}
}
return false;
}
Expand Down