Bug 290394 - 15.0-BETA2: pkg bootstrap fails with SSL certificate verification errors
Summary: 15.0-BETA2: pkg bootstrap fails with SSL certificate verification errors
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 15.0-CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-pkg (Nobody)
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2025-10-20 22:12 UTC by Jimmy Olgeni
Modified: 2025-10-27 03:10 UTC (History)
2 users (show)

See Also:
linimon: maintainer-feedback? (pkg)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jimmy Olgeni freebsd_committer freebsd_triage 2025-10-20 22:12:34 UTC
After system boot and login, any attempt to use pkg triggers the bootstrap process. When accepting the bootstrap prompt (answering 'Y'), pkg fails with repeated SSL certificate verification errors when attempting to fetch from pkg.FreeBSD.org. All SSL/TLS connections to FreeBSD package repositories fail with certificate verification errors for Let's Encrypt certificates.

(networking is functional while running the command)

Console log:

root@freebsd-15:~ # pkg bootstrap
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/quarterly, please wait...
Certificate verification failed for /C=US/O=Let's Encrypt/CN=E8
10A0E506B94F0000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:/usr/src/crypto/openssl/ssl/statem/statem_clnt.c:2124:
Certificate verification failed for /C=US/O=Let's Encrypt/CN=E8
10A0E506B94F0000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:/usr/src/crypto/openssl/ssl/statem/statem_clnt.c:2124:
Certificate verification failed for /C=US/O=Let's Encrypt/CN=E8
10A0E506B94F0000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:/usr/src/crypto/openssl/ssl/statem/statem_clnt.c:2124:
pkg: Error fetching https://pkg.FreeBSD.org/FreeBSD:15:amd64/quarterly/Latest/pkg.pkg: Authentication error
A pre-built version of pkg could not be found for your system.
Bootstrapping pkg from pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/kmods_quarterly_0, please wait...
Certificate verification failed for /C=US/O=Let's Encrypt/CN=E8
10A0E506B94F0000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:/usr/src/crypto/openssl/ssl/statem/statem_clnt.c:2124:
Certificate verification failed for /C=US/O=Let's Encrypt/CN=E8
10A0E506B94F0000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:/usr/src/crypto/openssl/ssl/statem/statem_clnt.c:2124:
Certificate verification failed for /C=US/O=Let's Encrypt/CN=E8
10A0E506B94F0000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:/usr/src/crypto/openssl/ssl/statem/statem_clnt.c:2124:
pkg: Error fetching https://pkg.FreeBSD.org/FreeBSD:15:amd64/kmods_quarterly_0/Latest/pkg.pkg: Authentication error
A pre-built version of pkg could not be found for your system.
Comment 1 devnull freebsd_committer freebsd_triage 2025-10-20 22:50:40 UTC
Can you provide additional steps to reproduce? 

Are the system date and time correct?

Thanks.


root@clean:~ # echo $SHELL
/bin/tcsh
root@clean:~ # pkg -v ; uname -mvKU
2.3.1
FreeBSD 15.0-BETA2 releng/15.0-n280713-7cd9d3fe838c GENERIC amd64 1500067 1500067
root@clean:~ # pkg delete -fqy pkg
root@clean:~ # pkg bootstrap
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/quarterly, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
Installing pkg-2.3.1...
Extracting pkg-2.3.1: 100%
root@clean:~ #
Comment 2 Colin Percival freebsd_committer freebsd_triage 2025-10-20 23:23:59 UTC
In addition to Graham's questions above, can you tell me how this system was installed?  From distribution sets, from pkgbase, using the "live" VM image we ship...?
Comment 3 Jimmy Olgeni freebsd_committer freebsd_triage 2025-10-21 00:02:42 UTC
This is from FreeBSD-15.0-BETA2-amd64-BASIC-CLOUDINIT-ufs.raw.xz, let me try again and check the date...
Comment 4 Jimmy Olgeni freebsd_committer freebsd_triage 2025-10-21 00:09:35 UTC
Date is ok, fetch could not use https at all, then I ran "certctl rehash" and it got back in shape! Now pkg bootstrap works too.
Comment 5 Jimmy Olgeni freebsd_committer freebsd_triage 2025-10-21 00:14:52 UTC
"/usr/sbin/certctl rehash" in user-data makes https work after boot.
Comment 6 Colin Percival freebsd_committer freebsd_triage 2025-10-22 20:56:26 UTC
I think this will be fixed by https://reviews.freebsd.org/D53263 .
Comment 7 commit-hook freebsd_committer freebsd_triage 2025-10-22 23:17:20 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=fa240b7ff081a49d44e0941b2090e5dc5838fe60

commit fa240b7ff081a49d44e0941b2090e5dc5838fe60
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-10-22 23:14:35 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2025-10-22 23:14:47 +0000

    packages: Update the METALOG when (un)installing the caroot package

    There may be other issues here but this change certainly seems to
    be necessary.

    PR:     290394
    Reviewed by:    cperciva
    Differential Revision:  https://reviews.freebsd.org/D53263

 release/packages/ucl/caroot.ucl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 8 commit-hook freebsd_committer freebsd_triage 2025-10-23 23:37:17 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=8b4585444728ca241d09cd230a3b8e27e3954847

commit 8b4585444728ca241d09cd230a3b8e27e3954847
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-10-22 23:14:35 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2025-10-23 23:36:09 +0000

    packages: Update the METALOG when (un)installing the caroot package

    There may be other issues here but this change certainly seems to
    be necessary.

    PR:     290394
    Reviewed by:    cperciva
    Differential Revision:  https://reviews.freebsd.org/D53263

    (cherry picked from commit fa240b7ff081a49d44e0941b2090e5dc5838fe60)

 release/packages/ucl/caroot.ucl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 9 commit-hook freebsd_committer freebsd_triage 2025-10-23 23:38:18 UTC
A commit in branch releng/15.0 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=a6538240790f367badad30bba70a7282529cb0c1

commit a6538240790f367badad30bba70a7282529cb0c1
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-10-22 23:14:35 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2025-10-23 23:36:32 +0000

    packages: Update the METALOG when (un)installing the caroot package

    There may be other issues here but this change certainly seems to
    be necessary.

    Approved by:    re (cperciva)
    PR:     290394
    Reviewed by:    cperciva
    Differential Revision:  https://reviews.freebsd.org/D53263

    (cherry picked from commit fa240b7ff081a49d44e0941b2090e5dc5838fe60)
    (cherry picked from commit 8b4585444728ca241d09cd230a3b8e27e3954847)

 release/packages/ucl/caroot.ucl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 10 Jimmy Olgeni freebsd_committer freebsd_triage 2025-10-26 10:36:52 UTC
Good to go in 15.0-BETA3 images \o/