-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp>
- Loading branch information
Showing
12 changed files
with
44 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
#!/bin/sh | ||
mkdir -p ../output/certs | ||
#!/bin/sh -ex | ||
|
||
if [ "$0" != "./gencerts.sh" ]; then | ||
echo "must be run from 'testdata'" | ||
exit 255 | ||
fi | ||
|
||
if ! which cfssl; then | ||
echo "cfssl is not installed" | ||
exit 255 | ||
fi | ||
|
||
mkdir -p ../output/certs/ | ||
cfssl gencert --initca=true ./ca-csr.json | cfssljson --bare ../output/certs/ca | ||
mv ../output/certs/ca.pem ../output/certs/ca.crt | ||
cfssl gencert --ca ../output/certs/ca.crt --ca-key ../output/certs/ca-key.pem --config ./config.json server-csr.json | cfssljson --bare ../output/certs/server | ||
if which openssl >/dev/null; then | ||
openssl x509 -in ../output/certs/ca.crt -noout -text | ||
fi | ||
|
||
# generate DNS: localhost, IP: 127.0.0.1, CN: example.com certificates | ||
cfssl gencert \ | ||
--ca ../output/certs/ca.crt \ | ||
--ca-key ../output/certs/ca-key.pem \ | ||
--config ./gencert.json \ | ||
./server-csr.json | cfssljson --bare ../output/certs/server | ||
mv ../output/certs/server.pem ../output/certs/server.crt | ||
mv ../output/certs/server-key.pem ../output/certs/server.key.insecure | ||
|
||
cd ../output/certs/ && rm -f *.pem *.stderr *.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters