0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

オレオレSSL証明書作成スクリプト

Last updated at Posted at 2020-03-14

自分用メモ。

有効期限398日間のオレオレ証明書を作成するスクリプト。

create_ssl_cert.sh

# !/bin/sh

domain=$1

crt_file="$domain.crt"
key_file="$domain.key"
subject="/C=JP/ST=Tokyo/L=Tokyo City/CN=*.$domain"

openssl req -new -newkey rsa:2048 -x509 -nodes \
  -set_serial 1 \
  -days 398 \
  -subj "$subject" \
  -out "$crt_file" -sha256\
  -keyout "$key_file" -sha256

使い方

$ ./create_ssl_cert.sh example.com

実行したディレクトリに
example.com.crt
example.com.key
が作成される。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?