https://github.com/atompi/self-signature
Create self-signature SSL cert via cfssl.
https://github.com/atompi/self-signature
Last synced: over 1 year ago
JSON representation
Create self-signature SSL cert via cfssl.
- Host: GitHub
- URL: https://github.com/atompi/self-signature
- Owner: atompi
- License: bsd-2-clause
- Created: 2023-05-30T06:59:20.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-31T08:27:48.000Z (almost 2 years ago)
- Last Synced: 2025-02-01T01:37:11.479Z (over 1 year ago)
- Size: 18.3 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Generate self-signed certs by cfssl
## create dirs
```
mkdir -p ca out
chmod 755 bin/*
```
## generate ca
```
cd ca
../bin/cfssl gencert -initca ../json/ca-csr.json|../bin/cfssljson -bare ca
```
## generate server-csr.json
```
export SELF_CN=atompi.cc
cat ../json/server-csr.json.tmpl | sed "s/SELF_CN/$SELF_CN/g" > ../json/$SELF_CN-server-csr.json
```
## create certs (If necessary, modify the certificate age in ca-config.json)
```
cd ../out
../bin/cfssl gencert -ca=../ca/ca.pem -ca-key=../ca/ca-key.pem -config=../json/ca-config.json -profile=peer ../json/$SELF_CN-server-csr.json | ../bin/cfssljson -bare $SELF_CN
```
## Usage
[USAGE](./USAGE.md)
## Tips
### get binary
```
mkdir -p bin
proxy wget https://github.com/cloudflare/cfssl/releases/download/v1.6.5/cfssl-certinfo_1.6.5_linux_amd64 -O bin/cfssl-certinfo
proxy wget https://github.com/cloudflare/cfssl/releases/download/v1.6.5/cfssljson_1.6.5_linux_amd64 -O bin/cfssljson
proxy wget https://github.com/cloudflare/cfssl/releases/download/v1.6.5/cfssl_1.6.5_linux_amd64 -O bin/cfssl
```
### generate default json
```
bin/cfssl print-defaults config > json/ca-config.json
bin/cfssl print-defaults csr > json/server-csr.json
```