#!/bin/sh

set -e

# Compile and install a custom https-get-expired program
# It will be used by htpdate, to accept certificates that are not valid yet

echo "Compiling and installing a custom https-get-expired program"

# Import ensure_hook_dependency_is_installed()
. /usr/local/lib/tails-shell-library/build.sh

ensure_hook_dependency_is_installed golang-go golang-src

echo "go env: will give us some details in case this program does not build reproducibly"
go env

PREFIX='' /usr/local/lib/build-https-accept-expired
rm /usr/local/lib/build-https-accept-expired
