💾 Archived View for envs.net › ~juhani › minigem › 20200706-minigem-notes.gmi captured on 2023-11-14 at 08:24:21. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2020-10-31)

-=-=-=-=-=-=-

minigem notes: client library implementation

2020-07-06

Implemented gemini client and cert storage on which to build TOFU. The client took exactly 100 lines of code :)

gemini_client.dart

cert_store.dart

Observations

Dart feels a lot like typescript but lexical binding makes it much nicer to work with.

Unit tests are easy to write but runtime environments caused some trouble. Tests that depend on android platform cannot run in the development enviroment. Instead they must built, uploaded to simulator and run there, using cli (flutter run test/store_test.dart). And you cannot access network, other that localhost, in the development environment. Of course you shouldn't use external resources in unit tests, but still...

Accepting self-signed certs requires specifying onBadCertificate handler. All responsibility about accepting cert is handed over to the handler, and it must explicitly check validity period and hostname.

gemini_client.dart lines 75-85

/~juhani