DEV Community

nabbisen
nabbisen

Posted on • Originally published at obsd.solutions

2

LibreSSL: openssl エラー - v3_ca エクステンションが存在しない

opensslLibreSSL ユーティリティの一つです。OpenBSD6.7 において、こちらを使って v3_ca エクステンションでルートならびに中間証明書を生成しようとすると、エラーが発生しました。

これは /etc/ssl/openssl.cnf にデフォルトで [ v3_ca ] セクションが存在しなかったためです。
解決方法は、必要に応じてバックアップを取得した後に、このセクションを追加することです。

$ doas cp -p /etc/ssl/openssl.cnf /etc/ssl/openssl.cnf.org
$ doas nvim /etc/ssl/openssl.cnf
Enter fullscreen mode Exit fullscreen mode

[ v3_ca ] セクションを追加します:

+ [ v3_ca ]
+ basicConstraints = critical,CA:TRUE
+ subjectKeyIdentifier = hash
+ authorityKeyIdentifier = keyid:always,issuer:always
Enter fullscreen mode Exit fullscreen mode

余談ですが私がこのエラーに遭遇したのは、PostgreSQL のサーバーとクライアント間で TLS 接続を確立しようとした時でした。以下のようなエラーが発生しました:

$ # create a root certificate authority
[...]
$ openssl x509 -req -in root.csr -text -days 36500 -extfile /etc/ssl/openssl.cnf -extensions v3_ca -signkey root.key -out root.crt
Error Loading extension section v3_ca
Enter fullscreen mode Exit fullscreen mode

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay