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 1 year has passed since last update.

オレオレ証明書

Last updated at Posted at 2022-12-30

参考

オレオレ証明書作ってみる
OpenSSL HTTPS通信で警告が出ないオレオレ証明書の作成

サーバー証明書

ポイント

証明書(crt)作成の際にSANにドメインorIPを設定する

秘密鍵を作成

openssl genrsa 2048 > server.key

CSR作成

openssl req -new -key server.key > server.csr

オプションは全てEnterのみ

Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:
Email Address []:

SAN設定ファイル(san.txt)の作成

subjectAltName = DNS:local-avhub.com

証明書の作成

openssl x509 -days 3650 -req -sha256 -signkey server.key -extfile san.txt < server.csr > server.crt

MAMPへ配置

バーチャルホストに記述されている場所にサーバ証明書(crt,key)を配置する

http-vhosts.conf
<VirtualHost *:443>
    DocumentRoot "C:\MAMP\htdocs\avhub"
    ServerName local-avhub.com
    SSLEngine on
    # SSLCertificateFile "C:\MAMP\conf\apache\keys\server.crt"
    # SSLCertificateKeyFile "C:\MAMP\conf\apache\keys\server.key"
    SSLCertificateFile "C:\MAMP\htdocs\avhub\keys\server.crt"
    SSLCertificateKeyFile "C:\MAMP\htdocs\avhub\keys\server.key"
    <Directory "C:\MAMP\htdocs\avhub">
        AllowOverride all
    </Directory>
</VirtualHost>

サーバー証明書をインストール

(ルートCA(証明機関)の証明書をインポートする (Windows Tips))[https://www.ipentec.com/document/windows-import-root-ca-certification]

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?