Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use custom CSR #99

Closed
Manawyrm opened this issue Mar 23, 2018 · 2 comments
Closed

Use custom CSR #99

Manawyrm opened this issue Mar 23, 2018 · 2 comments

Comments

@Manawyrm
Copy link

Hi,

I'm currently trying to use acmephp in some self-written software.
AcmeClient->finalizeOrder unfortunatly only accepts CSRs in the form of CertificateRequest-objects, not directly as a CSR, because the requestCertificate-Method then calls signCertificateRequest to generate a CSR.

I'd like to provide a custom CSR as a string. Any ideas on how to nicely implement this?
One method I could imagine would be to have a string-variable in CertificateRequest that you could populate with a custom CSR, another would be a second method that accepts CSRs directly.

Any suggestions on how to implement this? Would you accept a pull request implementing this functionality?

so long,
Tobi

@jderusse
Copy link
Contributor

I like the idea!

To keep BC, I think the best way to do it to:

  • Update CertificateRequest to add methods isSigned, setSignature, getSignature
  • Create a CertificateRequestFactory with methods createFromString, and createFromDistinguishedName (don't forget to parse the string and provide a DistinguishedName. Beware some methods like requestCertificate uses the $csr->getDistinguishedName()->getSubjectAlternativeNames() which rely on subject alternatives name inside the CSR, but methods like openssl_csr_get_subject may not return those informations)
  • Update the signCertificateRequest method to skip signature if the certificate is alreadySigned
  • You could also use the new getSignature method in finalizeOrder

Would be happy to accept such PR :-)

@xiaohuilam
Copy link
Contributor

But i think it might be conflicting with install feature (If subscriber does not use this, ignore then).

Reason:

  • Install feature need to read privateKey.
  • Provide csr means privateKey is not readable for ACME PHP (or other clients, whatever)

So, i think we'd to figure it out before trying to make it.

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

No branches or pull requests

4 participants