cPanel API2 installSSL issue
Hello,
I need help with cpapi2 installSSL.
I"m using CMD option described on manual:
(the cert above is not real, it is changed. I put a quote only for readability ) First, on the manual, cabundle is not required, I"ve tried without, result is the same. I've tried to put cert in the single or double quote, doesn't work. However, I do parse the cert with a sed to get \\n in all spaces except in -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- Although it looks fine, it is possible that format of cert became irregular. Still, I'm stuck with this problem, maybe I do miss something else? It is installed Cpanel v74.0.5, CloudLinux Thanks
(the cert above is not real, it is changed. I put a quote only for readability ) First, on the manual, cabundle is not required, I"ve tried without, result is the same. I've tried to put cert in the single or double quote, doesn't work. However, I do parse the cert with a sed to get \\n in all spaces except in -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- Although it looks fine, it is possible that format of cert became irregular. Still, I'm stuck with this problem, maybe I do miss something else? It is installed Cpanel v74.0.5, CloudLinux Thanks
-
Hi @resolv_25 First I want to suggest using the UAPI function rather than the cPapi2 function for this: UAPI Functions - SSL::install_ssl - Developer Documentation - cPanel Documentation I would also suggest reading the following: Tutorial - Call UAPI's SSL::install_ssl Function in Custom Code - Developer Documentation - cPanel Documentation I believe the method's for installing an SSL listed in the documentation for the Install SSL function in Custom Code will be helpful in this instance. Thanks! 0 -
Hi @resolv_25
Hi, thanks for your reply. One thing isn't clear from manual, do I have to parse cert, cabundle and key on the same format:-----BEGIN CERTIFICATE-----\\nMIIEsTCCetc
I mean, do I have to put \\n in the space between lines. Probably yes as on the cpapi2. I would prefer to use shell instead Perl or PHP because one can use a ssh key and install it on various servers without need of further authentication. Well, I was hoping to use cpapi2 because it is not asking the private key. WHM GUI is also smart enough when providing the cert, it can automatically populate cabundle and key. However, I'll try with that. Regards,0 -
Hi @resolv_25 You're correct for cPapi2 it should include \\n for lines as indicated in the example the UAPI function should behave the same way as well. Thanks! 0
Please sign in to leave a comment.
Comments
3 comments