본문 바로가기

기타

[OpenSSL] 자체 서명된 SSL 인증서 만들기

728x90

자체 서명된 SSL 인증서 만들기

인증서 생성

openssl req -newkey rsa:4096 \
-x509 \
-sha256 \
-days 3650 \
-nodes \
-out www_sangchul_kr.crt \
-keyout www_sangchul_kr.key \
-subj "/C=KR/ST=Seoul/L=Jongno-gu/O=SangChul Co., Ltd./OU=Infrastructure Team/CN=www.sangchul.kr"

$ openssl req -newkey rsa:4096 \
> -x509 \
> -sha256 \
> -days 3650 \
> -nodes \
> -out www_sangchul_kr.crt \
> -keyout www_sangchul_kr.key \
> -subj "/C=KR/ST=Seoul/L=Jongno-gu/O=SangChul Co., Ltd./OU=Infrastructure Team/CN=www.sangchul.kr"
Generating a 4096 bit RSA private key
............................................................................................................................++
.............................++
writing new private key to 'www_sangchul_kr.key'
-----

인증서 확인

openssl x509 -in www_sangchul_kr.crt -text -noout

$ openssl x509 -in www_sangchul_kr.crt -text -noout
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            eb:d2:13:db:43:35:84:32
    Signature Algorithm: sha256WithRSAEncryption
        Issuer: C=KR, ST=Seoul, L=Jongno-gu, O=SangChul Co., Ltd., OU=Infrastructure Team, CN=www.sangchul.kr
        Validity
            Not Before: Jun 22 13:25:15 2021 GMT
            Not After : Jun 20 13:25:15 2031 GMT
        Subject: C=KR, ST=Seoul, L=Jongno-gu, O=SangChul Co., Ltd., OU=Infrastructure Team, CN=www.sangchul.kr
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                Public-Key: (4096 bit)
                Modulus:
                    00:a4:4f:47:77:4f:5a:c9:6b:a4:e8:a6:84:dc:c1:
                    00:99:70:a0:f5:6f:cb:7c:11:20:48:1a:99:be:95:
                    6c:e0:c3:03:85:88:bb:5f:40:2e:72:03:a8:d6:34:
                    fb:4b:42:be:8c:99:26:a5:18:67:a5:d0:c5:03:02:
                    fd:83:02:c3:8a:80:9d:76:e4:21:db:09:0c:ad:e7:
                    e0:aa:f3:e0:bb:8d:a9:80:c4:9d:b4:63:fa:e6:77:
                    b5:62:8d:85:5d:ad:fc:5b:2b:fc:d5:7f:89:44:b3:
                    25:f1:0d:4f:81:25:8c:dc:8b:ed:8a:b3:29:78:cb:
                    25:45:61:5b:f3:62:17:11:44:38:15:f7:b6:1f:05:
                    de:80:ed:97:25:a9:52:8a:7e:32:c6:66:66:7c:17:
                    93:c2:b8:82:14:69:c6:39:31:e7:84:c2:41:95:d8:
                    33:00:91:b8:d8:8a:44:ef:6e:f9:78:0e:89:a8:7e:
                    3a:84:bf:c3:1a:93:fc:43:f3:1c:31:21:1e:22:eb:
                    8f:a6:5e:06:82:0b:77:72:31:f3:68:fc:93:2c:0d:
                    56:8f:1b:6c:c0:8c:08:21:7e:21:41:ac:8e:04:3e:
                    ae:83:33:db:2f:15:5a:c7:10:72:20:b3:e7:dc:ca:
                    d4:1a:b3:2b:50:d8:5f:3d:ef:ca:fb:e5:29:1a:e2:
                    9a:ab:4a:09:bc:de:43:e1:29:82:06:3e:f9:48:c9:
                    cd:3a:e6:a3:9b:9d:72:46:a2:c8:eb:cc:79:ae:94:
                    f4:91:69:d6:9d:1b:36:32:26:5a:4e:05:80:eb:c1:
                    80:ad:6d:53:8c:f4:81:b2:6e:eb:b7:d1:8e:8e:99:
                    8b:a5:1f:57:64:50:c8:de:d6:fa:93:8d:d6:22:6c:
                    d1:f3:8b:0e:35:3a:82:46:de:88:11:d8:31:89:63:
                    bf:49:5e:07:b7:35:7f:df:c3:fc:33:fc:4f:76:ca:
                    3c:24:96:f9:ef:bb:d1:37:31:0d:4e:b9:51:0b:c8:
                    82:38:95:04:fa:06:47:81:48:ee:64:94:8c:83:e5:
                    a3:ab:10:84:bd:8a:38:ea:39:d1:cf:ec:bf:5c:a2:
                    f1:a6:82:3a:fd:37:f2:78:60:92:a2:a5:e0:d8:64:
                    da:03:17:70:e0:bd:0c:5a:d1:4b:b4:7b:8e:2f:b1:
                    b0:1b:88:ea:d0:cd:17:32:d3:45:87:ee:5a:4c:74:
                    68:bf:6b:cd:1a:c2:af:ed:04:f0:47:fb:e1:aa:99:
                    76:b7:61:2f:59:e4:19:55:7d:3c:66:18:e4:e2:01:
                    06:17:c8:44:5b:85:70:c7:e1:82:f5:56:6f:0f:3f:
                    d6:1d:a3:a8:90:47:0c:81:bf:69:46:7c:66:77:b7:
                    0e:b3:ff
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Subject Key Identifier:
                20:AD:E0:58:00:F1:9E:3F:58:D4:F7:49:F6:C2:2D:6D:E8:33:F5:4D
            X509v3 Authority Key Identifier:
                keyid:20:AD:E0:58:00:F1:9E:3F:58:D4:F7:49:F6:C2:2D:6D:E8:33:F5:4D

            X509v3 Basic Constraints:
                CA:TRUE
    Signature Algorithm: sha256WithRSAEncryption
         06:e7:a9:b2:55:34:a8:be:1c:d0:87:69:4e:06:6e:2a:56:00:
         ff:ef:57:db:53:d9:9f:9e:ff:cb:c7:25:a1:85:69:fd:96:2a:
         0f:b9:c4:84:d6:9d:9f:71:d7:6c:1f:13:1d:93:7d:45:25:c7:
         7d:ca:6f:58:07:4d:f6:af:d3:b3:9f:44:c9:af:ee:32:51:a1:
         12:b8:aa:bb:89:ba:aa:18:09:fa:df:6d:78:0e:d7:22:73:7e:
         28:c8:69:59:d9:67:a9:4f:c4:3b:11:cd:9b:d7:56:18:de:0f:
         db:4b:17:18:fc:1b:ac:d5:03:8b:d8:32:d3:3a:bc:0e:26:e7:
         55:dd:ae:1c:47:29:0a:03:78:64:62:6d:59:7b:0b:13:83:80:
         48:4b:62:b5:27:cf:46:15:20:78:8d:89:4b:09:88:05:c1:b0:
         9e:dc:f0:da:75:0b:88:19:f7:c4:22:e7:9a:1a:8c:d0:08:8b:
         b3:12:c6:02:0f:2e:01:fc:98:b1:e2:94:2d:e0:4b:e9:fc:ec:
         dc:0e:64:31:d4:df:07:a7:b2:3b:7d:65:2e:6b:f2:dc:81:1c:
         0e:ac:b4:99:9a:2b:d2:0f:2e:81:5d:2c:42:72:74:c6:d5:f5:
         77:06:5e:b0:21:b4:98:2c:0f:f8:1e:1a:90:63:e5:b8:0a:7c:
         86:8d:6c:1e:c4:23:84:c9:71:a1:41:10:77:75:10:d0:1a:c3:
         e9:9c:63:43:1d:a7:ed:cc:30:dd:42:81:65:f0:5b:80:89:ba:
         57:a8:9c:ad:f2:eb:cb:c1:08:f5:9b:a9:ed:8e:66:09:a0:96:
         d7:9d:73:94:fb:1f:93:b8:7d:af:66:b0:16:e6:94:01:7a:34:
         19:03:08:94:99:5f:91:58:df:62:4f:a1:1e:01:8d:c4:78:df:
         25:c8:14:50:b1:44:01:7c:f2:e4:e6:be:57:28:b7:fb:af:19:
         58:76:3e:41:cd:52:0d:00:44:d2:e3:99:bf:c1:34:9b:b9:34:
         26:0f:21:3e:ae:a0:09:98:78:d3:00:9a:af:bc:3c:08:c9:23:
         8b:fb:26:d5:5f:0b:0e:02:ec:11:b4:37:8e:07:f0:db:ad:b1:
         fd:9a:17:02:b2:81:78:d7:13:48:1c:cd:30:ed:4a:52:a1:9e:
         ee:44:a2:f6:fd:16:2e:d3:30:46:af:fd:8c:95:8b:4a:ba:e4:
         b6:21:35:ee:a6:8f:dc:34:4d:44:7b:e9:08:a3:0a:09:44:93:
         63:54:4f:0b:ca:91:9d:82:36:19:fa:fe:21:03:6e:18:a8:f2:
         6e:fa:b6:41:93:73:30:6c:92:4e:54:d9:6e:ab:83:6e:e7:55:
         24:40:53:bb:9e:c6:81:8b
728x90