BlueSSLService icon indicating copy to clipboard operation
BlueSSLService copied to clipboard

Error when running via ssh on macOS

Open niklassaers opened this issue 8 years ago • 3 comments

In SSLService.swift, the line

status = SecPKCS12Import(p12Data, options, &items)

will return status == 0 and items as an empty array if I ssh into a macOS system and exercise it there. If I log in via Screen Sharing an do the same exercise, it runs well.

I suspect this has to do with the keychain services not being available. I submitted a PR to make the error nicer (it resulted in an index-out-of-bounds before), but I don't know what to replace SecPKCS12Import with that doesn't require keychain services

niklassaers avatar Jun 08 '17 19:06 niklassaers

Work-around is to call

security unlock-keychain security list-keychain -s "jenkins-test"

before using SSLService.

niklassaers avatar Jun 08 '17 19:06 niklassaers

I'll take a look. Thanks.

billabt avatar Jun 08 '17 20:06 billabt

@niklassaers I'm encountering similar issue. It works if I run my code in Xcode but doesn't work if I run it from the shell, which is what I need. Can you tell me more about the keychain? Any information will help.

When I run it in Xcode, I get a popup to give access. Not sure how I can bypass this.

It do have several Keychain when I run security list-keychain, but it seems like I need something else.

alexisoyama avatar Aug 21 '18 16:08 alexisoyama