Skip to content

Instantly share code, notes, and snippets.

@Rillke
Rillke / check-host-with-leaf-cert.sh
Created February 26, 2022 10:02
Check a leaf SSL server certificate presented by a specified host on a specified port.
#!/usr/bin/env bash
set -euo pipefail
if [ -z "${1+x}" ] || [ -z "${2+x}" ]
then
echo "Check a leaf ssl server certificate presented by a specified host"
echo "on a specified port."
echo "Expect exit code 0 upon success, non-zero otherwise."
echo ""
@Rillke
Rillke / Taskfile
Last active June 5, 2022 08:12
Taskit task in order to deploy a certficate during CI
# This was used to deploy Certificates during CI deployments from GitLab CI
# You need files at HTTPS_KEY and HTTPS_CERT (easily done with GitLab Variables of type file)
# HTTPS_CERT is expected to contain a chain
Task::deploy_cert () {
: @desc "Deploy certificate from GitLab runner to its designated position"
: @param target_dir="$HOME/ilias"
: @param cert_dir_name="certs-$(date +'%Y-%m-%d_%H-%M-%S%z')"