Files
nutshell/cashu/mint/management_rpc/generate_certificates.sh
lollerfirst 29571287b3 Mint Management gRPC Server (#723)
* settings

* fix name settings

* management rpc

* hook up the RPC server

* working

* format

* update build script fix import error

* remove accidental commit of vscode extension data

* working ✔

* \n

* add get mint quote get melt quote

* gRPC cli update quotes commands

* update mint melt quotes from cli

* comment under get cli command group

* keyset rotation not yet implemented

* try fix

* change back contact info default to be empty list

* fix import

* add server mTLS

* ll

* script for generating certificates

* rename settings

* move generation script

* do not save TTL expiry into Cache object, rather always load from settings.

* update lightning fees

* update auth limits

* auth rate limit cli

* optional arguemnts

* better error messages

* tests for db update mint/melt quotes

* start mint rpc tests

* add tos_url field to get-info grpc response

* format checks

* add types to click groups where it's needed

* tests on updating quotes

* fix tests

* skip updating mint quote state if on regtest

* test edge case

* unified test_add_remove_contact

* mark pytest-asyncio

* fix missing db argument

* hopefully no more silly errors

* fix test_db_update_mint_quote_state

* pass in the quote id string.

* add keyset rotation

* test for keyset rotation through gRPC command

* fix logger warning

* remove rotation test because it breaks other tests

* use different bolt11 invoices

* assert returned melt quote has quote

* is_postgres

* try different things

* skip if deprecated api

* format checks

* update .gitignore

* default location for certificates
2025-06-25 12:35:53 +02:00

31 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
echo "*** WARNING: this script is only to be used for development/testing purposes! ***"
sleep 2
echo -n "Continue? [Y/n]: "
read -r response
if [[ "$response" =~ ^[Yy]$ ]]; then
echo "Continuing..."
else
exit 1
fi
echo "Generating CA certificate..."
openssl genpkey -algorithm RSA -out ca_private.pem
openssl req -x509 -new -key ca_private.pem -sha256 -days 365 -out ca_cert.pem -subj "/CN=cashuCA"
echo "Generating server certificate"
openssl genpkey -algorithm RSA -out server_private.pem
openssl req -new -key server_private.pem -out server.csr -subj "/CN=localhost"
openssl x509 -req -in server.csr -CA ca_cert.pem -CAkey ca_private.pem -CAcreateserial -out server_cert.pem -days 365 -sha256
echo "Generating client certificate"
openssl genpkey -algorithm RSA -out client_private.pem
openssl req -new -key client_private.pem -out client.csr -subj "/CN=client"
openssl x509 -req -in client.csr -CA ca_cert.pem -CAkey ca_private.pem -CAcreateserial -out client_cert.pem -days 365 -sha256
echo "Removing intermediate fiels..."
rm server.csr client.csr ca_cert.srl
echo "All done!"