File: generate_test_cert.sh

package info (click to toggle)
python-hvac 2.3.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,800 kB
  • sloc: python: 29,360; makefile: 42; sh: 14
file content (20 lines) | stat: -rwxr-xr-x 884 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"

openssl genrsa -out "$DIR/../config_files/ca-key.pem" 2048

openssl req -x509 -new -nodes \
     -key "$DIR/../config_files/ca-key.pem" -sha256 \
     -days 1825 -out "$DIR/../config_files/ca-cert.pem" \
     -config "$DIR/../config_files/ca.cnf"

openssl req -x509 -nodes -days 3650 \
    -newkey rsa:2048 -keyout "$DIR/../config_files/server-key.pem" \
    -out "$DIR/../config_files/server-cert.pem" -config "$DIR/../config_files/server.cnf"

openssl req -new -sha256 -key "$DIR/../config_files/server-key.pem" \
    -out "$DIR/../config_files/server-cert.csr" -config "$DIR/../config_files/server.cnf"

openssl req -x509 -nodes -days 3650 \
    -newkey rsa:2048 -keyout "$DIR/../config_files/client-key.pem" \
    -out "$DIR/../config_files/client-cert.pem" -config "$DIR/../config_files/client.cnf"