OpenBSD(6.4)にCA証明書を追加する方法

OpenBSD(6.4)にCA証明書を追加する方法

OpenBSDにCA証明書を追加しようとしています。

  • 私はそれをコピーしましたconmpany.crt/etc/ssl/private
  • .0証明書からファイルを作成しましたopenssl x509 -hash -noout -in company.crt
  • 私はopenssl verify -CApath /etc/ssl/private/ company.crt良い結果を得ました。company.crt: OK

しかし、試してみると、次のようなcurl -vi https://company.example/結果が得られます。

*   Trying 192.168.XXX.XXX...
* TCP_NODELAY set
* Connected to company.example (192.168.XXX.XXX) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS alert, unknown CA (560):
* SSL certificate problem: unable to get local issuer certificate
* Closing connection 0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

私がメッセージから収集したことから、カールは/ inを見ます/etc/ssl/cert.pem。ファイルに追加することもできますが、.crta)正しい方法が何であるかわかりません。b)ルート証明書をすべて更新するたびに削除されませんか?私たち自身の証明書を別の場所に保管できたらと思います。これまでは.0明らかにファイルが必要なもの以外、Google では多くの情報を見つけることができません。しかし、次はどうなりますか?使用証明書を見つける場所はありません。

ああ、そしてエラーメッセージに与えられたリンク(https://curl.haxx.se/docs/sslcerts.html)あまり役に立ちません。


確かに言えば、これは私がDebianマシンでやったことで、うまくいきました:

  • コピーcompany.crt場所/usr/local/share/ca-certificates/companycompanyディレクトリが存在chmod 755company.crt存在する場所chmod 644
  • 走るupdate-ca-certificates
  • ...
  • 利益

ベストアンサー1

次の最後に証明書を追加できます/etc/ssl/cert.pem

# cat mycert.pem >> /etc/ssl/cert.pem

これは更新後も保持されます(参照man sysmerge)。

時にはこのファイルが無視されることに注意してください(たとえば、一部のブラウザは独自のCAストアのみを信頼します)。

おすすめ記事