adoptium / adoptium/adoptium-support

macOS Notarization issues with jdk 20 (temurin) and jpackage

Open
#829 7 comments 0 reactions 0 assignees View on GitHub
bug jbs:needs-report
Dominant language
No language data
Stars
59
Forks
13
PR merge metrics
No merged PRs in 30d

Description

### Please provide a brief summary of the bug

I am building an application with jpackage and notarization fails.
The last time I got it working was on jdk17. JDK 19 also fails and jdk 20 as well:
I don't know whether this is a jdk bug in jpackage or something at temurin is not signed at all correctly.

Signing works etc. codesign reports all fine, but on submitting for notarization I get errros
(I also tested with a simple zip file of the app)

### Please provide steps to reproduce where possible

I have set up a sample application for reproducing the case: https://github.com/Siedlerchr/testnotarization

1. Add the signing key username is build.gradle
2. Run ./gradlew jpackage --info
3. xcrun notarytool store-credentials "notarytool-profile" --apple-id "xxxx@xxxx.xx" --team-id "12345667" --password "xxxxx"
4. Run xcrun notarytool submit build/distribution/JabRef-1.0.0.dmg --keychain-profile "notarytool-profile" --wait
5. App is rejected, check xcrun notarytool log --keychain-profile "notarytool-profile"

### Expected Results

Notarization is successful

### Actual Results

Notarization fails

### What Java Version are you using?

openjdk version "20.0.1" 2023-04-18 OpenJDK Runtime Environment Temurin-20.0.1+9 (build 20.0.1+9) OpenJDK 64-Bit Server VM Temurin-20.0.1+9 (build 20.0.1+9, mixed mode)

### What is your operating system and platform?

macos Ventura 13.4 (22F66) on arm64

### How did you install Java?

sdkman

### Did it work before?

```Shell
jdk 17
```

### Did you test with the latest update version?

_No response_

### Did you test with other Java versions?

```Shell
yes, tested with temurin 19 as well
```

### Relevant log output

```Shell
"logFormatVersion": 1,
"jobId": "245c7a47-f605-4943-a1da-11f7320a35a3",
"status": "Invalid",
"statusSummary": "Archive contains critical validation errors",
"statusCode": 4000,
"archiveFilename": "JabRef.zip",
"uploadDate": "2023-06-24T16:28:21.836Z",
"sha256": "7d9d8d185cff905f4c2edfbacf8ec2edd6124e591989c2b35ce3bfdb1f791d0d",
"ticketContents": null,
"issues": [
{
"severity": "error",
"code": null,
"path": "JabRef.zip/JabRef.app/Contents/MacOS/JabRef",
"message": "The binary is not signed with a valid Developer ID certificate.",
"docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
"architecture": "arm64"
},
{
"severity": "error",
"code": null,
"path": "JabRef.zip/JabRef.app/Contents/MacOS/JabRef",
"message": "The signature does not include a secure timestamp.",
"docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
"architecture": "arm64"
},
{
"severity": "error",
"code": null,
"path": "JabRef.zip/JabRef.app/Contents/MacOS/JabRef",
"message": "The executable does not have the hardened runtime enabled.",
"docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087724",
"architecture": "arm64"
},
{
"severity": "error",
"code": null,
"path": "JabRef.zip/JabRef.app/Contents/runtime/Contents/Home/bin/jarsigner",
"message": "The binary is not signed with a valid Developer ID certificate.",
"docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
"architecture": "arm64"
},
{
"severity": "error",
"code": null,
"path": "JabRef.zip/JabRef.app/Contents/runtime/Contents/Home/bin/jarsigner",
"message": "The signature does not include a secure timestamp.",
"docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
"architecture": "arm64"
},
{
"severity": "error",
"code": null,
"path": "JabRef.zip/JabRef.app/Contents/runtime/Contents/Home/bin/jarsigner",
"message": "The executable does not have the hardened runtime enabled.",
"docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087724",
"architecture": "arm64"
},
{
"severity": "error",
"code": null,
"path": "JabRef.zip/JabRef.app/Contents/runtime/Contents/Home/bin/jfr",
"message": "The binary is not signed with a valid Developer ID certificate.",
"docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721",
"architecture": "arm64"
}
```

Contributor guide

Open the contributing guide

Research direction

Start with the linked testnotarization repository and its build.gradle, then run ./gradlew jpackage --info using Temurin 17, 19, and 20 on macOS Ventura. Inspect the xcrun notarytool log for the generated JabRef.app and runtime binaries; done means identifying whether the rejection is caused by the Temurin distribution or jpackage and documenting a reproducible result.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, macos
Domain
build-system, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.