Some applications expect subject DNs to be unique.
Bug #13609.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
must_not_exist "$arg1-privkey.pem"
must_not_exist "$arg1-req.pem"
make_tmpdir
+ # Use uuidgen or date to create unique subject DNs.
+ unique=`(uuidgen) 2>/dev/null` || unique=`date +"%Y %b %d %T"`
cat > "$TMP/req.cnf" <<EOF
[ req ]
prompt = no
L = Palo Alto
O = Open vSwitch
OU = Open vSwitch certifier
-CN = Open vSwitch certificate for $arg1
+CN = $arg1 id:$unique
EOF
if test $keytype = rsa; then
(umask 077 && openssl genrsa -out "$1-privkey.pem" $bits) 1>&3 2>&3 \