• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2
3if [ -z "$1" ] ; then
4	echo "Usage $0 <name>"
5	exit 1
6fi
7
8mkdir -p certs
9openssl genrsa -out $1.key 4096 && \
10printf "\\n\\n\\n\\n\\nlocalhost\\n\\n1234\\n\\n" | \
11 openssl req -config tmp.cnf -new -key $1.key -out $1.csr && \
12openssl ca -config tmp.cnf \
13 	-keyfile ca.key \
14	-cert ca.pem \
15	-extensions server_cert \
16	-days 375 \
17	-notext \
18	-md sha256 \
19       	-in $1.csr \
20	-out $1.pem
21
22