简体   繁体   English

如何调试OSX代码签名拒绝?

[英]How to debug OSX code signing rejection?

I'm signing an install4j installer for OSX, however OSX is rejecting it. 我正在为OSX签名install4j安装程序,但是OSX拒绝了它。 The system log only reports that it was rejected, and spctl only reports that it was rejected, with no explanation. 系统日志仅报告它被拒绝,而spctl仅报告它被拒绝,没有解释。 How can I determine why it was rejected? 我如何确定为什么拒绝呢?

I presume you're talking about Gatekeeper not allowing your app to run after it's downloaded? 我认为您是在谈论关守,不允许您的应用程序在下载后运行? Gatekeeper's rules aren't based on a list of rules to reject an app, they're based on a list of possible rules to accept an app, and if your app doesn't match any or those rules. Gatekeeper的规则不是基于拒绝应用程序的规则列表,而是基于可接受应用程序的可能规则列表,如果您的应用程序不匹配任何一个或那些规则。 This makes it hard to log eg why your app was rejected beyond "it didn't match any of the allow rules". 这使得很难记录日志,例如,为什么您的应用程序被拒绝,原因是“它与任何允许规则都不匹配”。 Now, if you know which "allow" rule you expected to apply to it, you can try to debug it based on that, but Gatekeeper itself doesn't know this and hence isn't much help. 现在,如果您知道希望对它应用哪个“允许”规则,则可以尝试基于此规则进行调试,但是Gatekeeper本身并不知道这一点,因此没有太大帮助。

I'm assuming you want your app to be allowed under the "identified developer" rule? 我假设您希望根据“确定的开发人员”规则允许您的应用? If so, there are a couple of tests to look for obvious problems: first, run codesign -vv --deep-verify /path/to/yourapp.app , and make sure it prints "valid on disk" and "satisfies its Designated Requirement" (and doesn't give any errors) -- if not, something's wrong with the signature or the contents of the app. 如果是这样,则有一些测试来查找明显的问题:首先,运行codesign -vv --deep-verify /path/to/yourapp.app ,并确保它在磁盘上打印“ valid”并“满足其指定要求”。要求”(并且不会出现任何错误),如果没有,则签名或应用程序内容有问题。

Second, run codesign -dvv /path/to/yourapp.app , and make sure it the data it lists includes: 其次,运行codesign -dvv /path/to/yourapp.app ,并确保它列出的数据包括:

Authority=Developer ID Application: [Your name/company here]
Authority=Developer ID Certification Authority
Authority=Apple Root CA
Sealed Resources version=2 rules=[something] files=[something]

If the Authority list is different from that, you used the wrong certificate to sign it. 如果“授权机构”列表与此不同,则您使用了错误的证书对其进行签名。 If the Sealed Resources version is 1 or not listed, you signed it with an old version of OS X, and recent versions will reject the signature format. 如果Sealed Resources版本为1或未列出,则您使用OS X的旧版本对其进行签名,而最新版本将拒绝签名格式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM