Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

Create push certificate from existing csr #45

Closed
denisov-vlad opened this issue Jun 11, 2015 · 4 comments
Closed

Create push certificate from existing csr #45

denisov-vlad opened this issue Jun 11, 2015 · 4 comments
Labels

Comments

@denisov-vlad
Copy link

Hello. The same issue like in pem: fastlane-old/pem#53
I've realised that issue for me, but this tool works much faster. So I've tried to do the same:

  1. generated csv, pkey file like this:
csr, pkey = Spaceship.certificate.create_certificate_signing_request
  1. write csr and pkey variables to files
  2. run push create:
Spaceship.certificate.production_push.create!(csr: csr, bundle_id: "bundleid")

Everything OK.
But when I try to do the same with created files there is something wrong:

  1. read csr, pkey variables from files
  2. run push create:
Spaceship.certificate.production_push.create!(csr: csr, bundle_id: "bundleid")

irb output here:

push.rb(main):012:0* Spaceship.certificate.production_push.create!(csr: csr, bundle_id: "bundleid")push.rb(main):012:0*
push.rb(main):012:0>
NoMethodError: undefined method `to_pem' for #<String:0x007fe1142646f0>
    from /Library/Ruby/Gems/2.0.0/gems/spaceship-0.0.8/lib/spaceship/certificate.rb:239:in `create!'
    from push.rb:12
    from /usr/bin/irb:12:in `<main>'
@KrauseFx
Copy link
Contributor

This is an error on our site which needs to be fixed. @snatchev can you take a look at this or should I?

@snatchev
Copy link
Contributor

The csr parameter needed to be of type OpenSSL::X509::Request which responds to the to_pem method. With commit 4fcf860 if it's passed in as a String (as it would from File.read( ... )), the method casts the parameter to a Request.

Added a test that demonstrates this workflow.

@KrauseFx
Copy link
Contributor

Thank you @snatchev 👍

@fastlanebot
Copy link

This issue was migrated to fastlane/fastlane#3552. Please post all further comments there.

fastlane is now a mono repo, you can read more about the change in our blog post. All tools are now available in the fastlane main repo 🚀

@fastlane-old fastlane-old locked and limited conversation to collaborators Mar 12, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants