taler-android

Android apps for GNU Taler (wallet, PoS, cashier)
Log | Files | Refs | README | LICENSE

README.md (1652B)


      1 # The simulator's own CA
      2 
      3 The terminal builds every merchant URL with a hard-coded `https://` scheme --
      4 `ConfigFragment.sanitizeMerchantUrlAndUpdateFields` and
      5 `MainActivity.handleSetupIntent` both -- so a merchant backend the harness
      6 controls has to answer TLS. Patching that out of the app would mean testing
      7 something other than the app, so instead the `sim` build type carries one extra
      8 trust anchor and `backend/mockd.py` serves under it.
      9 
     10 What is in the tree:
     11 
     12 | File | What it is |
     13 | --- | --- |
     14 | `ca.crt` | the CA certificate, also copied to `merchant-terminal/src/sim/res/raw/sim_ca.crt` |
     15 | `srv.crt` | a certificate for `localhost`, signed by that CA |
     16 | `srv.ext` | the SAN/extension file used to sign it |
     17 
     18 What is **not**, and must not be: `ca.key`, `srv.key`, `srv.csr`, `srv.pem`,
     19 `ca.srl`. They are generated per installation and `.gitignore`d. A certificate
     20 without its private key authorises nobody, which is why shipping `ca.crt` in a
     21 never-published debug build type is safe.
     22 
     23 To generate a set on a new host:
     24 
     25 ```bash
     26 openssl req -x509 -newkey rsa:2048 -nodes -keyout ca.key -out ca.crt -days 3650 \
     27   -subj '/CN=Taler POS simulator CA/O=GNU Taler/OU=pos-simulator' \
     28   -addext 'basicConstraints=critical,CA:TRUE' \
     29   -addext 'keyUsage=critical,keyCertSign,cRLSign'
     30 openssl req -newkey rsa:2048 -nodes -keyout srv.key -out srv.csr \
     31   -subj '/CN=localhost'
     32 openssl x509 -req -in srv.csr -CA ca.crt -CAkey ca.key -CAcreateserial \
     33   -out srv.crt -days 3650 -extfile srv.ext
     34 cp ca.crt ../../merchant-terminal/src/sim/res/raw/sim_ca.crt
     35 ```
     36 
     37 and rebuild the APK: the trust anchor is compiled into it, so a new CA means a
     38 new build.