selfsign
is a command line tool to create self-signed SSL certificates, mainly for local testing.
It is notably used in my other project apache php-fpm alpine.
You have the choice between:
- composer install
composer require 8ctopus/self-sign
- download the phar
- or build it yourself
# download selfsign
curl -LO https://github.com/8ctopus/self-sign/releases/download/0.1.8/selfsign.phar
# check hash against the one published under releases
sha256sum selfsign.phar
# make phar executable
chmod +x selfsign.phar
# rename phar (from here on optional)
mv selfsign.phar selfsign
# move phar to /usr/local/bin/
mv selfsign /usr/local/bin/
selfsign --help
selfsign authority destination-dir
[INFO] generate certificate authority private key...
[INFO] generate certificate authority certificate...
[INFO] success!
selfsign certificate destination-dir test.com,www.test.com,api.test.com authority-dir
[INFO] generate self-signed SSL certificate for test.com...
[INFO] generate domain private key...
[INFO] create certificate signing request...
[INFO] create certificate config file...
[INFO] create signed certificate by certificate authority...
[INFO] success!
./build.sh
php src/EntryPoint.php authority demo
php src/EntryPoint.php certificate demo test.com,www.test.com,api.test.com demo