Skip to content

Commit

Permalink
Fix: no password for domain keys
Browse files Browse the repository at this point in the history
  • Loading branch information
hiteshnayak305 committed Sep 24, 2023
1 parent bc99b1b commit e3dae8b
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 12 deletions.
4 changes: 2 additions & 2 deletions generateDomainCert.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
. setenv.sh
. ./setenv.sh

# do nothing if already exists
if [[ -f ${DOMAIN_CRT_PATH} ]]
then
echo "Domain crt is already generated."
else
openssl req -new -key ${DOMAIN_KEY_PATH} -out ${DOMAIN_CSR_PATH} -passin env:DOMAIN_PASSWORD -config ${DOMAIN_OPENSSL_CONF_PATH}
openssl req -new -key ${DOMAIN_KEY_PATH} -out ${DOMAIN_CSR_PATH} -config ${DOMAIN_OPENSSL_CONF_PATH} #-passin env:DOMAIN_PASSWORD
openssl x509 -req -in ${DOMAIN_CSR_PATH} -CA ${ROOT_CA_CRT_PATH} -CAkey ${ROOT_CA_KEY_PATH} -passin env:ROOT_CA_PASSWORD -out ${DOMAIN_CRT_PATH} -days ${DOMAIN_EXPIRY_DAYS} -extfile ${DOMAIN_OPENSSL_CONF_PATH} -extensions v3_req
echo "Domain crt generated successfully at ${DOMAIN_CRT_PATH}"
rm ${DOMAIN_CSR_PATH}
Expand Down
6 changes: 3 additions & 3 deletions generateDomainKey.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
. setenv.sh
. ./setenv.sh

# do nothing if already exists
if [[ -f ${DOMAIN_KEY_PATH} ]]
then
echo "Domain key is already generated."
else
openssl genrsa -des3 -passout env:ROOT_CA_PASSWORD -out ${DOMAIN_KEY_PATH} 4096
openssl genrsa -out ${DOMAIN_KEY_PATH} 4096 #-des3 -passout env:ROOT_CA_PASSWORD
echo "Domain key generated successfully at ${DOMAIN_KEY_PATH}"
fi
openssl rsa -noout -text -in ${DOMAIN_KEY_PATH} -passin env:DOMAIN_PASSWORD
openssl rsa -noout -text -in ${DOMAIN_KEY_PATH} #-passin env:DOMAIN_PASSWORD
echo "Domain key verified successfully."
2 changes: 1 addition & 1 deletion generateRootCACert.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
. setenv.sh
. ./setenv.sh

# do nothing if already exists
if [[ -f ${ROOT_CA_CRT_PATH} ]]
Expand Down
2 changes: 1 addition & 1 deletion generateRootKey.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
. setenv.sh
. ./setenv.sh

# do nothing if already exists
if [[ -f ${ROOT_CA_KEY_PATH} ]]
Expand Down
2 changes: 1 addition & 1 deletion getbase64.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
. setenv.sh
. ./setenv.sh

echo "Root CA certificate :"
cat ${ROOT_CA_CRT_PATH} | base64 -w 0
Expand Down
2 changes: 1 addition & 1 deletion renewDomainCert.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
. setenv.sh
. ./setenv.sh

# Ask confirmation
echo "Domain is valid till : "
Expand Down
2 changes: 1 addition & 1 deletion renewRootCACert.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
. setenv.sh
. ./setenv.sh

# Ask confirmation
echo "Root CA is valid till : "
Expand Down
7 changes: 6 additions & 1 deletion req.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,9 @@ extendedKeyUsage = serverAuth, clientAuth
subjectAltName = @alt_names

[alt_names]
DNS.1 = *.hitesh.com
DNS.1 = *.kube.hitesh.com
DNS.2 = *.weave.hitesh.com
DNS.3 = *.skooner.hitesh.com
DNS.4 = *.gitea.hitesh.com
DNS.5 = *.jenkins.hitesh.com
DNS.6 = *.hitesh.com
2 changes: 1 addition & 1 deletion setenv.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
. secret.sh
. ./secret.sh

export BUILD_PATH=build
# root
Expand Down

0 comments on commit e3dae8b

Please sign in to comment.