Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

[macOS] HaveClip.app works only on first run after new (unique) build #3

Closed
i-to-r opened this issue Jun 20, 2021 · 0 comments · Fixed by #4
Closed

[macOS] HaveClip.app works only on first run after new (unique) build #3

i-to-r opened this issue Jun 20, 2021 · 0 comments · Fixed by #4

Comments

@i-to-r
Copy link
Contributor

i-to-r commented Jun 20, 2021

Errors:

  • -25293 errSecAuthFailed
  • -67030 errSecCSInfoPlistFailed

The HaveClip.app works only on first run after new (unique) build — can't access the client cert/key in keychain (Secure Transport macOS native TLS/SSL backend automatically puts it there).

  1. Clear (delete existing ".app") and build

    $ codesign -dvvvv HaveClip.app
    HaveClip.app: code object is not signed at all
    
    $ codesign -vvvv HaveClip.app
    HaveClip.app: code object is not signed at all
    In architecture: x86_64
  2. First run from Terminal (Ok) — see "run-1-[0,1].  .log"
    $ HaveClip.app/Contents/MacOS/HaveClip 
    Listening on QHostAddress("192.0.2.1") 9999
    Remote control socket "/Users/_/Library/Application Support/HaveFun.cz/HaveClip-dev/haveclip.sock"
    Send message 4 28 bytes
    Received message 36
    Send "text/html"
    Send "text/plain"
    Send message 6 753 bytes
    Confirmed
    Received message 28
    Unable to reach "192.0.2.2" : QAbstractSocket::RemoteHostClosedError
    Connection error QAbstractSocket::RemoteHostClosedError  (0):  "The TLS/SSL connection has been closed"
    Communicator::onDisconnect
    
    $ codesign -dvvvv HaveClip.app
    Executable=/Users/_/.../HaveClip.app/Contents/MacOS/HaveClip
    Identifier=cz.havefun.HaveClip-dev
    Format=app bundle with Mach-O thin (x86_64)
    CodeDirectory v=20100 size=5160 flags=0x2(adhoc) hashes=156+3 location=system
    Hash type=sha256 size=32
    CandidateCDHash sha256=00c3d9c6e70d6166cd8b1b4cf74627e651d600e4
    Hash choices=sha256
    Page size=4096
    CDHash=00c3d9c6e70d6166cd8b1b4cf74627e651d600e4
    Signature=adhoc
    Info.plist entries=11
    TeamIdentifier=not set
    Sealed Resources version=2 rules=13 files=2
    Internal requirements count=0 size=12
    
    $ codesign -vvvv HaveClip.app
    HaveClip.app: valid on disk
    HaveClip.app: satisfies its Designated Requirement

    🗒️ run-1-[0,1].  .log

    Note: In the program output and in the logs, you may have noticed the reference to cz.havefun.HaveClip-dev — I temporarily renamed HaveClip to HaveClip-dev in "Main.cpp:35" and in a custom "Info.plist" file (CFBundleIdentifier key).

  3. 2th run from Terminal (Error) — see "run-2-[0,0].  .log"
    $ HaveClip.app/Contents/MacOS/HaveClip 
    Listening on QHostAddress("192.0.2.1") 9999
    Remote control socket "/Users/_/Library/Application Support/HaveFun.cz/HaveClip-dev/haveclip.sock"
    Unable to reach "192.0.2.2" : QAbstractSocket::SocketError(13)
    Connection error QAbstractSocket::SocketError(13)  (0):  "SSLHandshake failed: -25293"
    Communicator::onDisconnect

    🗒️ run-2-[0,0].  .log

  4. Re‑sign (result: CodeDirectory location=systemlocation=embedded)
    $ codesign -f -s - HaveClip.app
    HaveClip.app: replacing existing signature
    
    $ codesign -dvvvv HaveClip.app
    Executable=/Users/_/.../HaveClip.app/Contents/MacOS/HaveClip
    Identifier=cz.havefun.HaveClip-dev
    Format=app bundle with Mach-O thin (x86_64)
    CodeDirectory v=20100 size=5160 flags=0x2(adhoc) hashes=156+3 location=embedded
    VersionPlatform=1
    VersionMin=658432
    VersionSDK=658944
    Hash type=sha256 size=32
    CandidateCDHash sha256=4444444444444444444444444444444444444444
    Hash choices=sha256
    Page size=4096
    CDHash=4444444444444444444444444444444444444444
    Signature=adhoc
    Info.plist entries=11
    TeamIdentifier=not set
    Sealed Resources version=2 rules=13 files=2
    Internal requirements count=0 size=12
    
    $ codesign -vvvv HaveClip.app
    HaveClip.app: valid on disk
    HaveClip.app: satisfies its Designated Requirement
  5. 3th run from Terminal (Ok) — see "run-3-[1,1].  .log"
    $ HaveClip.app/Contents/MacOS/HaveClip 
    Listening on QHostAddress("192.0.2.1") 9999
    Remote control socket "/Users/_/Library/Application Support/HaveFun.cz/HaveClip-dev/haveclip.sock"
    Send message 4 28 bytes
    Received message 36
    Send "text/plain"
    Send message 6 66 bytes
    Confirmed
    Received message 28
    Unable to reach "192.0.2.2" : QAbstractSocket::RemoteHostClosedError
    Connection error QAbstractSocket::RemoteHostClosedError  (0):  "The TLS/SSL connection has been closed"
    Communicator::onDisconnect

    🗒️ run-3-[1,1].  .log

  6. 4th run from Terminal (Ok) — see "run-4-[1,0].  .log"
    $ HaveClip.app/Contents/MacOS/HaveClip 
    Listening on QHostAddress("192.0.2.1") 9999
    Remote control socket "/Users/_/Library/Application Support/HaveFun.cz/HaveClip-dev/haveclip.sock"
    Send message 4 28 bytes
    Received message 36
    Send "text/plain"
    Send message 6 90163 bytes
    Confirmed
    Received message 28
    Unable to reach "192.0.2.2" : QAbstractSocket::RemoteHostClosedError
    Connection error QAbstractSocket::RemoteHostClosedError  (0):  "The TLS/SSL connection has been closed"
    Communicator::onDisconnect

    🗒️ run-4-[1,0].  .log

Links:

Also:

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

Successfully merging a pull request may close this issue.

1 participant