ariane/README.md

98 lines
4.9 KiB
Markdown
Raw Normal View History

2020-09-29 09:43:41 +00:00
# Ariane (formerly Två, and briefly Gem)
2020-09-03 19:49:38 +00:00
2020-09-12 20:21:16 +00:00
A Gemini protocol browser for Android based OS
2020-09-03 19:49:38 +00:00
## Releases
2020-09-29 09:43:41 +00:00
See the project page on Öppenlab.net for latest download: [oppenlab.net/pr/ariane](https://oppenlab.net/pr/ariane/)
2020-09-06 19:31:57 +00:00
2020-10-31 19:34:43 +00:00
## TLS
**Note: Ariane is currently failing for some Gemini addresses (mostly any flounder.online capsules)**
2020-10-31 19:34:43 +00:00
From the [Gemini specification](https://gemini.circumlunar.space/docs/specification.html):
> Use of TLS for Gemini transactions is mandatory.
> Use of the Server Name Indication (SNI) extension to TLS is also mandatory, to facilitate name-based virtual hosting.
Ariane uses TLS but does not implement TOFU at all:
2020-10-31 19:34:43 +00:00
> Clients can validate TLS connections however they like (including not at all) but the strongly RECOMMENDED approach is to implement a lightweight "TOFU" certificate-pinning system which treats self-signed certificates as first- class citizens
### Client TLS
> Although rarely seen on the web, TLS permits clients to identify themselves to servers using certificates
From the spec:
* Short-lived client certificates which are generated on demand and deleted immediately after use can be used as "session identifiers" to maintain server-side state for applications. In this role, client certificates act as a substitute for HTTP cookies, but unlike cookies they are generated voluntarily by the client, and once the client deletes a certificate and its matching key, the server cannot possibly "resurrect" the same value later (unlike so-called "super cookies").
* Long-lived client certificates can reliably identify a user to a multi-user application without the need for passwords which may be brute-forced. Even a stolen database table mapping certificate hashes to user identities is not a security risk, as rainbow tables for certificates are not feasible.
* Self-hosted, single-user applications can be easily and reliably secured in a manner familiar from OpenSSH: the user generates a self-signed certificate and adds its hash to a server-side list of permitted certificates, analogous to the .authorized_keys file for SSH).
Looking at [Kristall](https://kristall.random-projects.net/) a client should offer full cert management, including import and export. Ariane has NONE of this currently.
2020-10-31 19:34:43 +00:00
A key sentence in the spec:
> Gemini requests will typically be made without a client certificate.
Client certs should only be required for protected content:
> Gemini requests will typically be made without a client certificate. If a requested resource requires a client certificate and one is not included in a request, the server can respond with a status code of 60, 61 or 62 (see Appendix 1 below for a description of all status codes related to client certificates). A client certificate which is generated or loaded in response to such a status code has its scope bound to the same hostname as the request URL and to all paths below the path of the request URL path. E.g. if a request for gemini://example.com/foo returns status 60 and the user chooses to generate a new client certificate in response to this, that same certificate should be used for subsequent requests to gemini://example.com/foo, gemini://example.com/foo/bar/, gemini://example.com/foo/bar/baz, etc., until such time as the user decides to delete the certificate or to temporarily deactivate it. Interactive clients for human users are strongly recommended to make such actions easy and to generally give users full control over the use of client certificates.
From this it's clear general requests should NOT use a client cert (to protect user identity if nothing else), if a server requests a client cert we should offer various configurations:
2020-10-31 19:34:43 +00:00
* Always use identity cert
* Always use a fresh session cert
* Prompt user
That's it as far as the spec is concered, the rest is down to the Android API
## Android TLS
2020-11-03 20:15:06 +00:00
* [SSLSocket](https://developer.android.com/reference/javax/net/ssl/SSLSocket)
* [Android keystore system](https://developer.android.com/training/articles/keystore.html)
Ariane is failing a socket handshake with the flounder.online gemini server, server details: https://www.ssllabs.com/ssltest/analyze.html?d=flounder.online
```
socket error: javax.net.ssl.SSLHandshakeException: Read error: ssl=0xb4000075dcd530d8: Failure in SSL library, usually a protocol error
```
Flounder tls details:
`openssl s_client -showcerts -connect flounder.online:1965`
```
CONNECTED(00000003)
depth=0
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0
verify error:num=21:unable to verify the first certificate
verify return:1
---
Certificate chain
0 s:
i:
-----BEGIN CERTIFICATE-----
```
compared to a working capsule:
`openssl s_client -showcerts -connect gus.guru:1965`
```
CONNECTED(00000003)
depth=0 CN = gus.guru
verify error:num=18:self signed certificate
verify return:1
depth=0 CN = gus.guru
verify return:1
---
Certificate chain
0 s:CN = gus.guru
i:CN = gus.guru
-----BEGIN CERTIFICATE-----
```