Stop describing a certificate approval as a pin
What changed, and why it matters
This commit only rewords comments and a test name. It changes the phrase 'approval pins the certificate' to 'approval accepts the certificate' and clarifies that only untrusted certificates reach the custom check. There is no code behavior change.
No action needed; this is a non-functional documentation/test-label change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff is purely cosmetic: a docstring in lib/utilities/tls_certificate.dart and a test description in test/utilities/electrum_tls_test.dart are updated to avoid calling certificate approval a ‘pin’. The logic of trustedCertificateCheck and the test body remain identical.
Changed components
lib/utilities/tls_certificate.dart (documentation only)test/utilities/electrum_tls_test.dart (test description only)Inspect captured patch +3 / −3
### lib/utilities/tls_certificate.dart
@@ -30,8 +30,8 @@ String? certificatePemFingerprint(String pem) {
/// The check a TLS connection runs when the platform rejects the server's
/// certificate. It accepts exactly the certificate approved for the node,
-/// whatever its hostname or validity, because the approval pins that
-/// certificate. Null when nothing is approved, so the platform's verdict
+/// whatever its hostname or validity. A certificate the platform trusts
+/// never reaches it. Null when nothing is approved, so the platform's verdict
/// stands. Throws a [FormatException] for a damaged PEM before connecting.
bool Function(X509Certificate)? trustedCertificateCheck(
String? certificatePem,
### test/utilities/electrum_tls_test.dart
@@ -122,7 +122,7 @@ void main() {
expect(server.requests, 0);
});
- test('approval pins the certificate even after it expired', () async {
+ test('approval accepts the certificate even after it expired', () async {
final server = await start(certificateName: 'expired');
final rejected = await check(server);
expect(rejected.success, false);Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.