GitHub

@@ -165,7 +165,7 @@ The connection fails if either do not match.

165165

Mutual-TLS between Two Machines

166166

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

167167168-

However, for a two-machine setup, self-signed certificates distributed using an out-of-band mechanism will also work just fine:

168+

For a two-machine setup, self-signed certificates distributed using an out-of-band mechanism will also work just fine:

169169170170

Suppose you have a push-mode setup, with `backups.example.com` running the :ref:`sink job <job-sink>`, and `prod.example.com` running the :ref:`push job <job-push>`.

171171

Run the following OpenSSL commands on each host, substituting HOSTNAME in both filenames and the interactive input prompt by OpenSSL:

@@ -218,19 +218,19 @@ Tools like `EasyRSA <https://github.com/OpenVPN/easy-rsa>`_ make this very easy:

218218

#!/usr/bin/env bash

219219

set -euo pipefail

220220221-

HOSTS=(backupserver prod1 prod2 prod3)

221+

HOSTS=(backupserver prod1 prod2 prod3 10.23.42.1)

222222223-

curl -L https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.7/EasyRSA-3.0.7.tgz > EasyRSA-3.0.7.tgz

224-

echo "157d2e8c115c3ad070c1b2641a4c9191e06a32a8e50971847a718251eeb510a8 EasyRSA-3.0.7.tgz" | sha256sum -c

225-

rm -rf EasyRSA-3.0.7

226-

tar -xf EasyRSA-3.0.7.tgz

227-

cd EasyRSA-3.0.7

228-

./easyrsa

229-

./easyrsa init-pki

230-

./easyrsa build-ca nopass

223+

curl -L https://github.com/OpenVPN/easy-rsa/releases/download/v3.2.5/EasyRSA-3.2.5.tgz > EasyRSA-3.2.5.tgz

224+

echo "662ee3b453155aeb1dff7096ec052cd83176c460cfa82ac130ef8568ec4df490 EasyRSA-3.2.5.tgz" | sha256sum -c

225+

rm -rf EasyRSA-3.2.5

226+

tar -xf EasyRSA-3.2.5.tgz

227+

cd EasyRSA-3.2.5

228+

./easyrsa --batch

229+

./easyrsa --batch init-pki

230+

./easyrsa --batch build-ca nopass

231231232232

for host in "${HOSTS[@]}"; do

233-

./easyrsa build-serverClient-full $host nopass

233+

./easyrsa --batch --auto-san build-serverClient-full $host nopass

234234

echo cert for host $host available at pki/issued/$host.crt

235235

echo key for host $host available at pki/private/$host.key

236236

done

Read the original on github.com ↗