mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
Merge "ast_tls_cert: Allow private key size to be set on command line" into 13
This commit is contained in:
@@ -49,7 +49,7 @@ create_ca () {
|
|||||||
create_cert () {
|
create_cert () {
|
||||||
local base=${OUTPUT_DIR}/${OUTPUT_BASE}
|
local base=${OUTPUT_DIR}/${OUTPUT_BASE}
|
||||||
echo "Creating certificate ${base}.key"
|
echo "Creating certificate ${base}.key"
|
||||||
openssl genrsa -out ${base}.key 1024 > /dev/null
|
openssl genrsa -out ${base}.key ${KEYBITS:-1024} > /dev/null
|
||||||
if [ $? -ne 0 ];
|
if [ $? -ne 0 ];
|
||||||
then
|
then
|
||||||
echo "Failed"
|
echo "Failed"
|
||||||
@@ -87,6 +87,7 @@ OPTIONS:
|
|||||||
-f Config filename (openssl config file format)
|
-f Config filename (openssl config file format)
|
||||||
-c CA cert filename (creates new CA cert/key as ca.crt/ca.key if not passed)
|
-c CA cert filename (creates new CA cert/key as ca.crt/ca.key if not passed)
|
||||||
-k CA key filename
|
-k CA key filename
|
||||||
|
-b The desired size of the private key in bits. Default is 1024.
|
||||||
-C Common name (cert field)
|
-C Common name (cert field)
|
||||||
This should be the fully qualified domain name or IP address for
|
This should be the fully qualified domain name or IP address for
|
||||||
the client or server. Make sure your certs have unique common
|
the client or server. Make sure your certs have unique common
|
||||||
@@ -128,7 +129,7 @@ OUTPUT_BASE=asterisk # Our default cert basename
|
|||||||
CERT_MODE=server
|
CERT_MODE=server
|
||||||
ORG_NAME=${DEFAULT_ORG}
|
ORG_NAME=${DEFAULT_ORG}
|
||||||
|
|
||||||
while getopts "hf:c:k:o:d:m:C:O:" OPTION
|
while getopts "hf:c:k:o:d:m:C:O:b:" OPTION
|
||||||
do
|
do
|
||||||
case ${OPTION} in
|
case ${OPTION} in
|
||||||
h)
|
h)
|
||||||
@@ -144,6 +145,9 @@ do
|
|||||||
k)
|
k)
|
||||||
CAKEY=${OPTARG}
|
CAKEY=${OPTARG}
|
||||||
;;
|
;;
|
||||||
|
b)
|
||||||
|
KEYBITS=${OPTARG}
|
||||||
|
;;
|
||||||
o)
|
o)
|
||||||
OUTPUT_BASE=${OPTARG}
|
OUTPUT_BASE=${OPTARG}
|
||||||
;;
|
;;
|
||||||
|
Reference in New Issue
Block a user