#!/bin/bash
# $Header: /cvs/WebShield/wsrc/files/mgmt/make_ssl_cert,v 1.4 2004/02/02 14:19:14 bwhittak Exp $
#
# (C) Copyright Network Associates Inc. 2001
#
# Create SSL certificate from the request file
#
if [ -f $NETAWSS/.profile.vars ]; then 
 . $NETAWSS/.profile.vars 
else 
 . /var/NAIENV/.profile.vars 
fi 
PATH=$wsPATH:$PATH
shopt -s extglob

# we don't want stdin
exec </dev/null

# load in the system info functions
. sysinfo-functions

# names of SSL files
wsscnf=$NETAWSS/ui/uiconf/openssl.cnf	# WebShield prototype
sslcnf=/usr/share/ssl/openssl.cnf
sslkey=/etc/httpd/conf/ssl.key/server.key
sslcrt=/etc/httpd/conf/ssl.crt/server.crt

openssl genrsa -out "$sslkey" 1024
chmod 400 "$sslkey"
openssl req -new -x509 -days 3650 -key "$sslkey" -out "$sslcrt"

exit 0
