homebrew-delve icon indicating copy to clipboard operation
homebrew-delve copied to clipboard

security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.

Open jesse881025 opened this issue 7 years ago • 11 comments

admins-MBP:~ admin$ brew install go-delve/delve/delve /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin16/rbconfig.rb:213: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin16/rbconfig.rb:213: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777 ==> Installing delve from go-delve/delve ==> Downloading https://github.com/derekparker/delve/archive/v1.0.0-rc.1.tar.gz Already downloaded: /Users/admin/Library/Caches/Homebrew/delve-1.0.0-rc.1.tar.gz security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain. ==> Generating dlv-cert ==> openssl req -new -newkey rsa:2048 -x509 -days 3650 -nodes -config dlv-cert.c ==> [SUDO] Installing dlv-cert as root ==> sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System. Last 15 lines from /Users/admin/Library/Logs/Homebrew/delve/02.sudo: 2017-08-21 16:38:32 +0800

sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain dlv-cert.cer

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core): https://github.com/go-delve/homebrew-delve/issues

These open issues may also help: Mac install error, OS version 10.12.6, go version go1.8.3 https://github.com/go-delve/homebrew-delve/issues/17 The specified item could not be found in the keychain https://github.com/go-delve/homebrew-delve/issues/16 Issue updating to 0.12.2 https://github.com/go-delve/homebrew-delve/issues/12 Executable does not get installed on MacOS https://github.com/go-delve/homebrew-delve/issues/18 dlv-cert: no identity found https://github.com/go-delve/homebrew-delve/issues/1 deps: do not install go if it's available on the system https://github.com/go-delve/homebrew-delve/issues/9 Mac install Error https://github.com/go-delve/homebrew-delve/issues/3 Mac install Error https://github.com/go-delve/homebrew-delve/issues/7

jesse881025 avatar Aug 21 '17 09:08 jesse881025

To get around this, just run the last 2 commands manually. openssl req -new -newkey rsa:2048 -x509 -days 3650 -nodes -config dlv-cert.cfg -extensions codesign_reqext -batch -out dlv-cert.cer -keyout dlv-cert.key and sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain dlv-cert.cer The content of dlv-cert.cfg is

[ req ]
default_bits            = 2048                  # RSA key size
encrypt_key             = no                    # Protect private key
default_md              = sha512                # MD to use
prompt                  = no                    # Prompt for DN
distinguished_name      = codesign_dn           # DN template
[ codesign_dn ]
commonName              = "dlv-cert"
[ codesign_reqext ]
keyUsage                = critical,digitalSignature
extendedKeyUsage        = critical,codeSigning

This will get you pass the cert part. You should see ==> dlv-cert is already installed, no need to create it

sergeyhush avatar Aug 27 '17 18:08 sergeyhush

Hit this problem as well. You also need to run:

sudo security import dlv-cert.key -A -k /Library/Keychains/System.keychain

aluzzardi avatar Aug 31 '17 00:08 aluzzardi

Following these steps (only in 1) worked for me: https://github.com/derekparker/delve/wiki/Installation-on-OSX#1-create-a-self-signed-certificate

savv avatar Sep 13 '17 17:09 savv

actually I did this: cd $HOME/Library/Caches/Homebrew tar xf delve-*.gz go into directory ( mine is delve-1.0.0-rc.1 ) sh scripts/gencert.sh

it will asks for password, and you're done. After that just re run brew install go-delve/delve/delve

and it will pass without problems

andreakappa avatar Sep 19 '17 06:09 andreakappa

I did: go get -u github.com/derekparker/delve/cmd/dlv

TheScoot avatar Sep 26 '17 22:09 TheScoot

Creating the dlv-cert.cfg and then running the commands described in https://github.com/go-delve/homebrew-delve/issues/19#issuecomment-325214701

and then adding the cert to the keychain as said in https://github.com/go-delve/homebrew-delve/issues/19#issuecomment-326151904 worked for me

The content of dlv-cert.cfg is

[ req ]
default_bits            = 2048                  # RSA key size
encrypt_key             = no                    # Protect private key
default_md              = sha512                # MD to use
prompt                  = no                    # Prompt for DN
distinguished_name      = codesign_dn           # DN template
[ codesign_dn ]
commonName              = "dlv-cert"
[ codesign_reqext ]
keyUsage                = critical,digitalSignature
extendedKeyUsage        = critical,codeSigning

Then

openssl req -new -newkey rsa:2048 -x509 -days 3650 -nodes -config dlv-cert.cfg -extensions codesign_reqext -batch -out dlv-cert.cer -keyout dlv-cert.key and sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain dlv-cert.cer

Finally

sudo security import dlv-cert.key -A -k /Library/Keychains/System.keychain

nfiandrino avatar Oct 11 '17 19:10 nfiandrino

I have this error too. Trying to run openssl req -new -newkey rsa:2048 -x509 -days 3650 -nodes -config dlv-cert.cfg -extensions codesign_reqext -batch -out dlv-cert.cer -keyout dlv-cert.key I get .

~ ❯❯❯ openssl req -new -newkey rsa:2048 -x509 -days 3650 -nodes -config dlv-cert.cfg -extensions codesign_reqext -batch -out dlv-cert.cer -keyout dlv-cert.key
error on line -1 of dlv-cert.cfg
38545:error:02001002:system library:fopen:No such file or directory:/BuildRoot/Library/Caches/com.apple.xbs/Sources/OpenSSL098/OpenSSL098-64.50.6/src/crypto/bio/bss_file.c:126:fopen('dlv-cert.cfg','rb')
38545:error:2006D080:BIO routines:BIO_new_file:no such file:/BuildRoot/Library/Caches/com.apple.xbs/Sources/OpenSSL098/OpenSSL098-64.50.6/src/crypto/bio/bss_file.c:129:
38545:error:0E078072:configuration file routines:DEF_LOAD:no such file:/BuildRoot/Library/Caches/com.apple.xbs/Sources/OpenSSL098/OpenSSL098-64.50.6/src/crypto/conf/conf_def.c:197:

Not sure what to do next. Am I missing a dep?

joesustaric avatar Oct 14 '17 07:10 joesustaric

Run into the same issue. Get the genscript.sh from here: https://github.com/derekparker/delve/blob/master/scripts/gencert.sh Run it and then brew install go-delve/delve/delve

heraclitusq avatar Oct 21 '17 12:10 heraclitusq

Youtube video tutorial: https://youtu.be/4K2bDLzYiAQ

KanybekMomukeyev avatar Nov 09 '17 08:11 KanybekMomukeyev

@heraclitusq's solution worked for me on macOS 10.13.3 - thanks!

rxacevedo avatar Feb 23 '18 22:02 rxacevedo

Calling the scripts/gencerts.sh script explained by @andreakappa works fine to get the formula installed.

tboerger avatar Mar 30 '18 21:03 tboerger