This repository has been archived on 2022-09-21. You can view files and clone it, but cannot push or open issues or pull requests.
simplexmq/tests/fixtures
Evgeny Poberezkin 17888f89a9
test notification token with agent and notifications server (#353)
* test notification token with agent and notifications server

* notification server test with APNS mock

* set environment variables in the test

* use base64url encoding in encrypted notification data
2022-04-18 08:57:55 +01:00
..
.gitignore chain of two certificates - offline (identity) and online; switch certificates to v3 (#238) 2021-12-23 21:20:41 +04:00
AuthKey_H82WD9K9AQ.p8 test notification token with agent and notifications server (#353) 2022-04-18 08:57:55 +01:00
README.md add IP and FQDN to online certificate (#278) 2022-01-11 16:35:06 +04:00
ca.crt add IP and FQDN to online certificate (#278) 2022-01-11 16:35:06 +04:00
ca.key add IP and FQDN to online certificate (#278) 2022-01-11 16:35:06 +04:00
openssl_ca.conf add IP and FQDN to online certificate (#278) 2022-01-11 16:35:06 +04:00
openssl_server.conf remove Subject Alternative Names from server certificate (#281) 2022-01-11 20:48:27 +04:00
server.crt remove Subject Alternative Names from server certificate (#281) 2022-01-11 20:48:27 +04:00
server.key remove Subject Alternative Names from server certificate (#281) 2022-01-11 20:48:27 +04:00

README.md

To generate fixtures:

(keep these instructions and openssl_ca.conf and openssl_server.conf files consistent with certificate generation on server)

# CA certificate (identity/offline)
openssl genpkey -algorithm ED448 -out ca.key
openssl req -new -x509 -days 999999 -config openssl_ca.conf -extensions v3 -key ca.key -out ca.crt

# Server certificate (online)
openssl genpkey -algorithm ED448 -out server.key
openssl req -new -config openssl_server.conf -reqexts v3 -key server.key -out server.csr
openssl x509 -req -days 999999 -extfile openssl_server.conf -extensions v3 -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt

# To pretty-print
openssl x509 -in ca.crt -text -noout
openssl req -in server.csr -text -noout
openssl x509 -in server.crt -text -noout

To compute fingerprint for tests:

stack ghci
> import Data.X509.Validation (Fingerprint (..))
> Fingerprint fp <- loadFingerprint "tests/fixtures/ca.crt"
> strEncode fp