1
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?

NetBSDで証明書(ca-certificate)を更新する(NetBSD-9系以前までの手順)

Last updated at Posted at 2025-12-31

NetBSD Advent Calendar 2025 16日目の記事です。今日はNetBSDで証明書(ca-certificate)を更新する話をしようと思います。

概要

  • 今回はNetBSD-9系での手順になります。
  • pkgin update を実行した際、証明書周りでエラーが発生した。
# pkgin update
processing remote summary (https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/9.0/All)...
2994023424:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:/usr/src/crypto/external/bsd/openssl/dist/ssl/statem/statem_clnt.c:1915:
2994023424:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:/usr/src/crypto/external/bsd/openssl/dist/ssl/statem/statem_clnt.c:1915:
2994023424:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:/usr/src/crypto/external/bsd/openssl/dist/ssl/statem/statem_clnt.c:1915:
pkgin: Could not fetch https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/9.0/All/pkg_summary.xz: Authentication error

NetBSD-9系以前での証明書更新手順

  • 証明書更新まわりの手順は、NetBSD-9以前とNetBSD-10以降で使用するツールが異なっている。
  • NetBSD-9系では証明書の更新に使用するツールが何種類か存在しており、今回は update-ca-certificates を使用して証明書を更新する。
    • ちなみにこのツールはLinux環境で使用されているツールのようで、NetBSDにおいてはライセンス的にベースに組み込めないようだ。
# file /usr/pkg/sbin/update-ca-certificates
/usr/pkg/sbin/update-ca-certificates: POSIX shell script, ASCII text executable
#
# /usr/pkg/sbin/update-ca-certificates
Please enable update-ca-certificates by setting ETCCERTSDIR
to an absolute path (e.g. /etc/openssl/certs) in
  /usr/pkg/etc/ca-certificates-dir.conf
and then run update-ca-certificates again.
#
# # 上記のエラーメッセージの翻訳。
update-ca-certificates を有効にするには、
/usr/pkg/etc/ca-certificates-dir.conf 内で
ETCCERTSDIR を絶対パス(例: /etc/openssl/certs)に設定し、
再度 update-ca-certificates を実行してください。
#
# # 変更箇所を確認する。
# diff -u /usr/pkg/etc/ca-certificates-dir.conf.ORIG /usr/pkg/etc/ca-certificates-dir.conf
--- /usr/pkg/etc/ca-certificates-dir.conf.ORIG  2025-12-29 16:46:57.551851297 +0900
+++ /usr/pkg/etc/ca-certificates-dir.conf       2025-12-29 16:47:22.417936232 +0900
@@ -2,7 +2,7 @@
 #
 # The directory managed by update-ca-certificates(8)
 #
-#ETCCERTSDIR=/etc/openssl/certs
+ETCCERTSDIR=/etc/openssl/certs
 #
 # Remove the # to uncomment the setting and to enable managing
 # installed certificates in the specified directory.
#
# # ディレクトリの有無を確認する。
# ls -lha /etc/openssl/certs
total 192K
drwxr-xr-x  2 root  wheel  512B Mar 28  2025 ./
drwxr-xr-x  5 root  wheel  512B Mar 28  2025 ../
-rw-r--r--  1 root  wheel  191K Mar 28  2025 ca-certificates.crt
#
# # update-ca-certificatesを再実行する。
# /usr/pkg/sbin/update-ca-certificates
Updating certificates in /etc/openssl/certs...
rehash: warning: skipping ca-certificates.crt,it does not contain exactly one certificate or CRL
     146 added,        0 removed; done.
#
  • 無事に pkgin update でのエラーが解消された。
# pkgin update
processing remote summary (https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/9.0/All)...
pkg_summary.gz

まとめ

NetBSD-9系で証明書(ca-certificate)を更新する手順を紹介しました。いざ問題が発生してから対応方法を調べたりするのはバタバタしがちなので、このような地味にハマると面倒なケースはこまめにメモとして残しておきたいところです。
(来年はもう少しNetBSDに触る機会を増やしたい感じです)

1
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
1
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?