Hi,
(long post, sorry).
TLDR: I signed and notarized my a.out executables, shared libs, and dmg file, but still get "developer cannot be verified" error. Why?
Gory details:
I am trying to get our MacOS app signed and notarized so it can be opened without the dreaded
"app cannot be opened because the developer cannot be verified" error.
The build and testing are all done in my iMac, which is running Catalina (10.15.6).
Our app is a smalltalk database app written in C++ without any GUI components (no bundles).
All executables are command line tools in a.out format.
All executables and shared libraries are signed.
The build is done exclusively via command line tools (not using Xcode, although Xcode is installed).
Here are the build steps:
Other resource files (text files, shell scripts, binary database data files, etc are not signed).
3. Create a disk image:
4. Sign the disk image
5. Have the disk image notarized
6. Notarization succeeds:
7. staple the disk image
Now I download the final signed, notarized and stapled, disk image with a browser (Chrome) and extract
it to a directory. That all works. But I still get "app cannot be opened because the developer cannot be verified" error when I attempt run any a.out.
The signature is valid:
and the check-security routine on the a.out passes:
My downloaded dmg is quarantined:
but so is the signaturecheck.dmg I downloaded from apple, and that opens without errors:
What do I have to do to avoid the "developer cannot be verified" error?
Norm Green
(long post, sorry).
TLDR: I signed and notarized my a.out executables, shared libs, and dmg file, but still get "developer cannot be verified" error. Why?
Gory details:
I am trying to get our MacOS app signed and notarized so it can be opened without the dreaded
"app cannot be opened because the developer cannot be verified" error.
The build and testing are all done in my iMac, which is running Catalina (10.15.6).
Our app is a smalltalk database app written in C++ without any GUI components (no bundles).
All executables are command line tools in a.out format.
All executables and shared libraries are signed.
The build is done exclusively via command line tools (not using Xcode, although Xcode is installed).
Here are the build steps:
Compile and link using g++ (clang) and make. This creates an installation directory tree /Users/normg/gs353/fast42/gs/root
Enable hardened runtime and sign all a.out executables and shared libraries with:
Code Block codesign --options runtime -s "72G58AHU7P" --entitlements /info.plist
Other resource files (text files, shell scripts, binary database data files, etc are not signed).
3. Create a disk image:
Code Block hdiutil create /Users/normg/tmp/GemStone64Bit3.5.3-i386.Darwin.dmg -srcfolder /Users/normg/gs353/fast42/gs/root
4. Sign the disk image
Code Block codesign -s "72G58AHU7P" /Users/normg/tmp/GemStone64Bit3.5.3-i386.Darwin.dmg
5. Have the disk image notarized
Code Block xcrun altool --notarize-app \ --primary-bundle-id "com.gemtalk.GemTalkServer" \ --username "norm.green@gemtalksystems.com" \ --password "@keychain:Developer-altool" \ --asc-provider "72G58AHU7P" \ --file "/Users/normg/tmp/GemStone64Bit3.5.3-i386.Darwin.dmg"
6. Notarization succeeds:
Code Block normg@idget>xcrun altool --notarization-info "7c78f26d-13c7-4a35-a29b-74ee66862282" --username "norm.green@gemtalksystems.com" --password "@keychain:Developer-altool" No errors getting notarization info. Date: 2020-07-16 16:50:44 +0000 Hash: 3a237b8ddf3fb412345e3c45971db135de2d23690b94995df73b84d47f367dc8 ... Status: success Status Code: 0 Status Message: Package Approved
7. staple the disk image
Code Block normg@idget>stapler staple /Users/normg/tmp/GemStone64Bit3.5.3-i386.Darwin.dmg Processing: /Users/normg/tmp/GemStone64Bit3.5.3-i386.Darwin.dmg Processing: /Users/normg/tmp/GemStone64Bit3.5.3-i386.Darwin.dmg The staple and validate action worked!
Now I download the final signed, notarized and stapled, disk image with a browser (Chrome) and extract
it to a directory. That all works. But I still get "app cannot be opened because the developer cannot be verified" error when I attempt run any a.out.
The signature is valid:
Code Block normg@idget>codesign -vvv ./vsdwishDarwin ./vsdwishDarwin: valid on disk ./vsdwishDarwin: satisfies its Designated Requirement
and the check-security routine on the a.out passes:
Code Block normg@idget>./check-signature /Users/normg/GemStone64Bit3.5.3-i386.Darwin/bin/vsdwishDarwin (c) 2014 Apple Inc. All rights reserved. YES
My downloaded dmg is quarantined:
Code Block normg@idget>xattr -l "GemStone64Bit3.5.3-i386.Darwin (1).dmg" com.apple.diskimages.fsck: ... com.apple.quarantine: 0181;5f10870d;Chrome;AAD23815-6326-4CC8-9178-42494E58AD50
but so is the signaturecheck.dmg I downloaded from apple, and that opens without errors:
Code Block normg@idget>xattr -l signaturecheck.dmg \com.apple.diskimages.fsck: ... com.apple.quarantine: 0081;5f0fe0f8;Chrome;11737297-FF43-481E-B7BE-B5063943F3EA
What do I have to do to avoid the "developer cannot be verified" error?
Norm Green