0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00
zot/test/scripts/gen_nameless_certs.sh
Doug Rabson 20391a21c0
fix: freebsd build support (#1659)
- Avoid hard-coding the path for bash - this typically is installed as
  /usr/local/bin/bash

- Allow for the fact that FreeBSD's rlimit uses signed integers

Almost all of the test suite passes with three test failures that I
haven't tried to debug yet.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2023-07-29 10:41:25 -07:00

47 lines
794 B
Bash
Executable file

#!/usr/bin/env bash
set -xe
openssl req \
-newkey rsa:2048 \
-nodes \
-days 3650 \
-x509 \
-keyout ca.key \
-out ca.crt \
-subj "/CN="
openssl req \
-newkey rsa:2048 \
-nodes \
-keyout server.key \
-out server.csr \
-subj "/OU=TestServer/CN="
openssl x509 \
-req \
-days 3650 \
-sha256 \
-in server.csr \
-CA ca.crt \
-CAkey ca.key \
-CAcreateserial \
-out server.cert \
-extfile <(echo subjectAltName = IP:127.0.0.1)
openssl req \
-newkey rsa:2048 \
-nodes \
-keyout client.key \
-out client.csr \
-subj "/OU=TestClient/CN="
openssl x509 \
-req \
-days 3650 \
-sha256 \
-in client.csr \
-CA ca.crt \
-CAkey ca.key \
-CAcreateserial \
-out client.cert