Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions Library/Formula/curl-ca-bundle.rb

This file was deleted.

29 changes: 10 additions & 19 deletions Library/Formula/openssl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,33 +45,24 @@ def openssldir
etc/"openssl"
end

def cert_pem
openssldir/"cert.pem"
end

def osx_cert_pem
openssldir/"osx_cert.pem"
end

def write_pem_file
def post_install
keychains = %w[
/Library/Keychains/System.keychain
/System/Library/Keychains/SystemRootCertificates.keychain
]

osx_cert_pem.atomic_write `security find-certificate -a -p #{keychains.join(" ")}`
openssldir.mkpath
(openssldir/"cert.pem").atomic_write `security find-certificate -a -p #{keychains.join(" ")}`
end

def post_install
openssldir.mkpath
def caveats; <<-EOS.undent
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
#{openssldir}/certs

if cert_pem.exist?
write_pem_file
else
cert_pem.unlink if cert_pem.symlink?
write_pem_file
openssldir.install_symlink 'osx_cert.pem' => 'cert.pem'
end
and run
#{opt_bin}/c_rehash
EOS
end

test do
Expand Down