Skip to content
This repository has been archived by the owner on Sep 20, 2018. It is now read-only.

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

Open
jesse881025 opened this issue Aug 21, 2017 · 11 comments

Comments

@jesse881025
Copy link

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 #17
The specified item could not be found in the keychain #16
Issue updating to 0.12.2 #12
Executable does not get installed on MacOS #18
dlv-cert: no identity found #1
deps: do not install go if it's available on the system #9
Mac install Error #3
Mac install Error #7

@sergeyhush
Copy link

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

@aluzzardi
Copy link

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

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

@savv
Copy link

savv commented Sep 13, 2017

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

@andreakappa
Copy link

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

@TheScoot
Copy link

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

@nfiandrino
Copy link

Creating the dlv-cert.cfg and then running the commands described in #19 (comment)

and then adding the cert to the keychain as said in #19 (comment) 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

@joesustaric
Copy link

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?

@heraclitusq
Copy link

heraclitusq commented Oct 21, 2017

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

@KanybekMomukeyev
Copy link

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

@rxacevedo
Copy link

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

@tboerger
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests