1#
2# CDDL HEADER START
3#
4# This file and its contents are supplied under the terms of the
5# Common Development and Distribution License ("CDDL"), version 1.0.
6# You may only use this file in accordance with the terms of version
7# 1.0 of the CDDL.
8#
9# A full copy of the text of the CDDL should have accompanied this
10# source.  A copy of the CDDL is also available via the Internet at
11# http://www.illumos.org/license/CDDL.
12#
13# CDDL HEADER END
14#
15
16#
17# Copyright (c) 2017 Datto, Inc. All rights reserved.
18#
19
20# $PASSPHRASE, $HEXKEY, and $RAWKEY must be kept in sync
21# with the corresponding files in this directory
22
23export PASSPHRASE="password"
24export PASSPHRASE1="password1"
25export PASSPHRASE2="password2"
26export HEXKEY="000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F"
27export HEXKEY1="201F1E1D1C1B1A191817161514131211100F0E0D0C0B0A090807060504030201"
28export RAWKEY="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
29export RAWKEY1="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
30
31export SSL_CA_CERT_FILE="/$TESTPOOL/snakeoil.crt"
32export HTTPS_PORT_FILE="/$TESTPOOL/snakeoil.port"
33export HTTPS_HOSTNAME="localhost"
34export HTTPS_PORT=
35export HTTPS_BASE_URL=
36
37function get_https_port
38{
39	if [ -z "$HTTPS_PORT" ]; then
40		read -r HTTPS_PORT < "$HTTPS_PORT_FILE" || return
41	fi
42
43	echo "$HTTPS_PORT"
44}
45
46function get_https_base_url
47{
48	if [ -z "$HTTPS_BASE_URL" ]; then
49		HTTPS_BASE_URL="https://$HTTPS_HOSTNAME:$(get_https_port)" || {
50			typeset ret=$?
51			HTTPS_BASE_URL=
52			return $ret
53		}
54	fi
55
56	echo "$HTTPS_BASE_URL"
57}
58