#! /bin/bash : ' Script used to create a self-signed certificate. This bash script is executed furing the creation of the container image to build a default certificate for nginx. SPDX-License-Identifier: Apache 2.0 ' if [ "$#" -ne 1 ] then echo "Error: No domain name argument provided" echo "Usage: Provide a domain name as an argument" exit 1 fi DOMAIN=$1 # Create root CA & Private key openssl req -x509 \ -sha256 -days 356 \ -nodes \ -newkey rsa:2048 \ -subj "/CN=${DOMAIN}/C=US/L=San Fransisco" \ -keyout rootCA.key -out rootCA.crt # Generate Private key openssl genrsa -out ${DOMAIN}.key 2048 # Create csf conf cat > csr.conf < cert.conf <