GNU/Linux >> Linux の 問題 >  >> Linux

OpenSSL Create Csr Template Error「テンプレートがありません。1つ設定してください。」?

Amazon LinuxAMI2017.03.0イメージでcsrを作成しようとしています。
次のコマンドを実行してtest.keyを生成します

[root]# openssl genrsa -out test.key 2048
Generating RSA private key, 2048 bit long modulus
............+++
.........................+++
e is 65537 (0x10001)
[root]#

次に、以下を実行します:

[root]# openssl req -new -sha256 -key test.key -out test.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
No template, please set one up.
problems making Certificate Request
[root]#

「テンプレートはありません。設定してください」はopenssl.confファイルに関連しているようです

私のopenssl設定は次のとおりです:

[root]# pwd
/etc/ssl
[root]# ls -al
total 12
drwxr-xr-x  2 root root 4096 Apr  3 22:53 .
drwxr-xr-x 82 root root 4096 Apr 21 10:54 ..
lrwxrwxrwx  1 root root   16 Jan 20 23:25 certs -> ../pki/tls/certs
-rw-r--r--  1 root root  138 Apr  3 22:53 openssl.cnf
[root]# cat openssl.cnf
[ ssl_client ]
basicConstraints = CA:FALSE
nsCertType = client
keyUsage = digitalSignature, keyEncipherment
extendedKeyUsage = clientAuth
[root]# rpm -q -a |grep openssl
openssl-1.0.1k-15.99.amzn1.x86_64
[root]#

opensslテンプレートの作成に関する多くの情報はないようです。誰かが助けたり、例やチュートリアルへのリンクを教えてくれますか。

承認された回答:

ssl_clientスタンザにあるものは、csrを作成するときに適用されません。これらは実際には、CSRに署名するときにCAによって証明書に通常追加されるx509v3拡張属性であり、スタンザ名で参照されます。

openssl x509 ... -extensions ssl_client

件名フィールドに入力する必要がある場合は、次のようなものを使用する必要があります:

openssl req -new -sha256 -key test.key -out test.csr -subj "/C=SM/ST=somecountry/L=someloc/O=someorg/OU=somedept/CN=exa‌​mple.com"

reqを使用してデフォルトを指定する方法もあります およびreq_distinguished_name スタンザ。 reqで指定する 、openssl req ...のデフォルトを設定します 指図。 req_distinguished_nameを指定する サブジェクトDNコンポーネントに制限を設定したり、openssl req -new ...を使用して通常呼び出すインタラクティブCSR作成のデフォルトを設定したりできます。 など。

デフォルトは次のように設定できます:

[ req_distinguished_name ]
countryName_default             = SM
stateOrProvinceName_default     = somecountry
localityName_default            = someloc
...

コマンドラインopensslで何かをしたいときに私が通常参照する2つの素晴らしいページがあります:

関連:Magento –構成可能な製品と属性セット?

https://jamielinux.com/docs/openssl-certificate-authority/appendix/root-configuration-file.html

https://www.phildev.net/ssl/opensslconf.html


Linux
  1. VirtualBoxで「起動可能なメディアが見つかりません」エラーのトラブルシューティング

  2. 致命的なエラーopenssl/evp.h:そのようなファイルまたはディレクトリはありません:[解決済み]

  3. 共有ライブラリの読み込み中にエラーが発生しましたlibcrypto.so.1.1–OpenSSL[修正]

  1. 致命的なエラーopensslerr.hを修正–そのようなファイルまたはディレクトリはありません[OpenCA]

  2. Nginxを使用して1つのIPに複数のSSLを設定する方法

  3. シンボリックリンクの作成–存在する場合は上書きしますか?

  1. Crontabエラー「ルートにCrontabがありません」?

  2. Ubuntu - エラー:SD カードの作成に失敗しました

  3. Openssl :証明書チェーンのエラー自己署名証明書