Skip to content

Commit

Permalink
Merge pull request #119 from isimluk/cve-2016-4457
Browse files Browse the repository at this point in the history
Generate new certificate when the default one is not present
  • Loading branch information
carbonin committed Apr 27, 2017
2 parents 41844f7 + 4668411 commit 387fbf6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion initialize_appliance.sh
@@ -1,3 +1,12 @@
#!/bin/bash
set -e -o pipefail

[[ ! -f "/var/www/miq/vmdb/certs/v2_key" ]] && appliance_console_cli --key
KEYPATH="/var/www/miq/vmdb/certs"

[[ ! -f "$KEYPATH/v2_key" ]] && appliance_console_cli --key

CERT="$KEYPATH/server.cer"
KEY="$CERT.key"
if [ ! -f "$CERT" -a ! -f "$KEY" ]; then
(umask 077 ; openssl req -x509 -newkey rsa -days 1095 -keyout $KEY -out $CERT -subj "/CN=server" -nodes -batch)
fi

0 comments on commit 387fbf6

Please sign in to comment.