Skip to main content

install_service_ssl_certificate certificate formatting issue?

Comments

2 comments

  • cPanelMichael
    Hello :) Have you tried using the input URL directly in your browser to rule out any issues with your code? You can URI encode the key and certificate before doing so. A utility such as [url=http://www.url-encode-decode.com/]Url Encode/Decode might be helpful. Note that you may also find this documentation helpful: WHM API 1 - install_service_ssl_certificate Thank you.
    0
  • gwurr3
    Hello Michael, I had tried examples as such in the docfile ( with \n newlines, etc. ) and played around with it, but couldn't get that going. I had put a ticket in (5066019) and Chris was an awesome help. He had URL encoded the cert, and added the " &ca= " variable to the end of the request string, and now everything is working. my $ua = LWP::UserAgent->new; my $request = HTTP::Request->new( GET => "https://localhost:2087/json-api/install_service_ssl_certificate?api.version=1&service=dovecot&crt=$cert&key=$key&ca=" ); $request->header( Authorization => $auth ); my $response = $ua->request($request); print $response->content;
    The cert/key ended up looking as such -----BEGIN%20CERTIFICATE-----%(URL ENCODED CERT)-----END%20CERTIFICATE-----
    Thank you cPanelMichael and Chris from tickets.cpanel.net : )
    0

Please sign in to leave a comment.