Search code examples
azure-devopsxamarin.ios

##[error]Error: /usr/local/bin/openssl failed with return code: - Azure devops - Xamarin iOS


I am getting this error when I create and run my pipeline in YAML. I could able to successfully run my pipeline which I created in the classic editor.

- task: InstallAppleCertificate@2
  displayName: 'Install an Apple certificate'
  inputs:
    certSecureFile: ******-****-****-****-*********
    certPwd: ''
    setUpPartitionIdACLForPrivateKey: false

For certSecureFile, I tried with both security file codes and also tried giving its name (AFP_Distribution_Certificate.p12). But ended up getting the same error.


Solution

  • For us, the certSecureFile is the Name attribute in Secure Files (you can rename it in secure files).

    In our YAML pipeline for iOS build it looks like this:

    - task: InstallAppleCertificate@2
      inputs:
        certSecureFile: ${{parameters.certSecureFile}}
        certPwd: ${{parameters.certPwd}}
        keychain: 'temp'
    

    The parameters are:

    certSecureFile is the "Name" of the secure file in the Library / Secure files area.

    This secure file is a .p12 file - it's the private key exported from Keychain Access, after importing the .cer file downloaded from Apple. (Looks like yours is too).

    Our "update the certificate" documentation has specific instructions about making sure the certificate has the same name - we rename the previous certificate and naming the new one with "the" name. Something like myapp_certificate.p12 but it can be anything.

    The certPwd parameter comes from a credentials group stored via Library / Variable groups. It's got to match the password you used when you exported it from Keychain access. Strongly recommend you don't continue to use ''

    I don't know where our keychain: temp came from, but I doubt that's related to openSSL.

    (If you haven't resolved this already, it'd probably be worth putting the full error message in the body of the question too)