-
Notifications
You must be signed in to change notification settings - Fork 4
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
macOS: Support intermediate certificates #5
macOS: Support intermediate certificates #5
Conversation
src/main/java/org/jetbrains/nativecerts/mac/SecurityFrameworkUtil.java
Outdated
Show resolved
Hide resolved
src/test/java/org/jetbrains/nativecerts/mac/SecurityFrameworkUtilTest.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jetbrains/nativecerts/mac/SecurityFrameworkUtil.java
Outdated
Show resolved
Hide resolved
current state: I was able to call SecItemCopyMatching without errors and it even returns something. See ef3ec66 Basically, two things:
Could you please continue on PR and I'll try to help with JNA when required? |
… into verify-certificate-when-null-trust-setting
Thanks for the help, its working now, I'll take a look at tests and any refactoring needed later |
src/main/java/org/jetbrains/nativecerts/mac/SecurityFrameworkUtil.java
Outdated
Show resolved
Hide resolved
return false; | ||
} | ||
|
||
return SecurityFramework.INSTANCE.SecTrustEvaluateWithError(secTrustRefByReference.getSecTrustRef(), null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a WARN message that certificated is not trusted thus not imported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its valid for a certificate to be not trusted, its logged elsewhere:
LOGGER.fine("Certificate '" + certificateDescription + "' has no trust settings and failed to validate against trusted roots");
From failing tests, looks like system certificates are not imported |
Right (annoying github action not trusting me -.-) From stackoverflow: OpenJDK took the above approach: Although This looks like the supported way to do it though: I'll give |
I implemented I've implemented it using the key chain file system APIs. deprecated but still seems to be the recommended approach if you need to do this. |
squashed and pushed manually 477763d |
also added more checks: 96702ad |
Fixes #3
This works now, remaining before ready for review: