|
Lines 60-66
Link Here
|
| 60 |
L = ${SSL_LOCALITY} |
60 |
L = ${SSL_LOCALITY} |
| 61 |
O = ${SSL_ORGANIZATION} |
61 |
O = ${SSL_ORGANIZATION} |
| 62 |
OU = ${SSL_UNIT} |
62 |
OU = ${SSL_UNIT} |
| 63 |
CN = ${SSL_COMMONNAME} |
63 |
CN = ${SSL_COMMONNAME}${1:+ CA} |
| 64 |
emailAddress = ${SSL_EMAIL} |
64 |
emailAddress = ${SSL_EMAIL} |
| 65 |
EOF |
65 |
EOF |
| 66 |
eend $? |
66 |
eend $? |
|
Lines 130-138
Link Here
|
| 130 |
local base=`get_base $1` |
130 |
local base=`get_base $1` |
| 131 |
if [ "${1}" ] ; then |
131 |
if [ "${1}" ] ; then |
| 132 |
ebegin "Generating self-signed X.509 Certificate for CA" |
132 |
ebegin "Generating self-signed X.509 Certificate for CA" |
| 133 |
/usr/bin/openssl x509 -extfile "${SSL_CONF}" \ |
133 |
/usr/bin/openssl req -new -x509 -config "${SSL_CONF}" \ |
| 134 |
-days ${SSL_DAYS} -req -signkey "${base}.key" \ |
134 |
-days ${SSL_DAYS} -key "${base}.key" \ |
| 135 |
-in "${base}.csr" -out "${base}.crt" &>/dev/null |
135 |
-out "${base}.crt" &>/dev/null |
| 136 |
else |
136 |
else |
| 137 |
local ca=`get_base 1` |
137 |
local ca=`get_base 1` |
| 138 |
ebegin "Generating authority-signed X.509 Certificate" |
138 |
ebegin "Generating authority-signed X.509 Certificate" |
|
Lines 191-206
Link Here
|
| 191 |
return 1 ;; |
191 |
return 1 ;; |
| 192 |
esac |
192 |
esac |
| 193 |
|
193 |
|
| 194 |
# Initialize configuration |
|
|
| 195 |
gen_cnf || return 1 |
| 196 |
echo |
| 197 |
|
| 198 |
# Generate a CA environment |
194 |
# Generate a CA environment |
|
|
195 |
gen_cnf 1 || return 1 |
| 199 |
gen_key 1 || return 1 |
196 |
gen_key 1 || return 1 |
| 200 |
gen_csr 1 || return 1 |
|
|
| 201 |
gen_crt 1 || return 1 |
197 |
gen_crt 1 || return 1 |
| 202 |
echo |
198 |
echo |
| 203 |
|
199 |
|
|
|
200 |
# Regenerate config |
| 201 |
gen_cnf || return 1 |
| 202 |
echo |
| 203 |
|
| 204 |
local count=0 |
204 |
local count=0 |
| 205 |
for cert in "$@" ; do |
205 |
for cert in "$@" ; do |
| 206 |
# Check the requested certificate |
206 |
# Check the requested certificate |