blob: 16524c3e71df5ad7252161486113e28a9312d74c [file] [log] [blame]
Piotr Jaszczyka4becf22018-05-29 13:35:11 +02001#!/bin/bash
2set -eou pipefail
3
4if [[ $# < 2 ]]; then
5 echo "Please provide a key file prefix and a target host:port"
6 exit 1
7fi
8
9key_prefix=$1
10host_and_port=$2
11
12cert_file="$key_prefix.crt"
13key_file="$key_prefix.key"
14
15if [[ ! -r "$cert_file" ]]; then
16 echo "$cert_file is not readable"
17 exit 2
18fi
19
20if [[ ! -r "$key_file" ]]; then
21 echo "$key_file is not readable"
22 exit 2
23fi
24
25openssl s_client -connect $host_and_port -cert "$cert_file" -key "$key_file" -CAfile onap.crt
26