Tweak the ssl.conf generated by cert-gen.sh, so that pycurl doesn't trip itself
[arvados-k8s.git] / charts / arvados / cert-gen.sh
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: Apache-2.0
4
5 # Usage: ./cert-gen.sh <externalIP>
6
7 if [[ -z $1 ]] ; then
8     echo "ERROR: A floating IP must be supplied."
9     echo "Usage: $0 <externalIP>"
10     exit 1
11 fi
12
13 cat > ssl.conf <<EOF
14 [req]
15 distinguished_name = $1
16 x509_extensions = v3_req
17 prompt = no
18
19 [$1]
20 CN = arvados-test-cert
21
22 [v3_req]
23 keyUsage = keyEncipherment, dataEncipherment, digitalSignature
24 extendedKeyUsage = serverAuth
25 subjectAltName = @alt_names
26
27 [alt_names]
28 IP.1 = $1
29 EOF
30 openssl req -newkey rsa:2048 -nodes -keyout ./config/ssl/key -x509 -days 365 -out ./config/ssl/cert -config ssl.conf
31 rm ssl.conf