Skip to content
Snippets Groups Projects
generate-certificates.sh 563 B
Newer Older
  • Learn to ignore specific revisions
  • #!/bin/bash
    rm -f *.crt *.csr *.key *.pem *.srl
    openssl req -x509 -nodes -new -sha256 -days 1024 -newkey rsa:2048 -keyout RootCA.key -out RootCA.pem -subj "/C=US/CN=EcolyoBackOffice-Root-CA"
    openssl x509 -outform pem -in RootCA.pem -out RootCA.crt
    openssl req -new -nodes -newkey rsa:2048 -keyout localhost.key -out localhost.csr -subj "/C=US/ST=YourState/L=YourCity/O=EcolyoBackOffice-Certificates/CN=localhost.local"
    openssl x509 -req -sha256 -days 1024 -in localhost.csr -CA RootCA.pem -CAkey RootCA.key -CAcreateserial -extfile domains.ext -out localhost.crt