Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running via ssh on macOS #32

Open
niklassaers opened this issue Jun 8, 2017 · 3 comments
Open

Error when running via ssh on macOS #32

niklassaers opened this issue Jun 8, 2017 · 3 comments

Comments

@niklassaers
Copy link
Contributor

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
Copy link
Contributor Author

Work-around is to call

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

before using SSLService.

@billabt
Copy link
Collaborator

billabt commented Jun 8, 2017

I'll take a look. Thanks.

@alexisoyama
Copy link

@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.

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

No branches or pull requests

3 participants