Hello y'all,
I apologize if this is a repeat post. I haven't found anything quite like this on the web, yet.
So I've been banging my head against the wall trying to get the install_service_ssl_certificate API call to work.
i keep getting:
I've tried formatting with newline escape characters, spaces, etc etc. To no avail.
Here is what i've got so far:
So, my question is, how am I supposed to format the cert/key text? For either json or xml. Either will work for me.
Let's say for example I have a key that reads as such:
How would I format this into the URL request string properly?
If possible, I would appreciate if someone could point out where the xml vs json differences would be here, as well.
Anyways, Thank y'all VERY much for your time and help in advance. : )
I apologize if this is a repeat post. I haven't found anything quite like this on the web, yet.
So I've been banging my head against the wall trying to get the install_service_ssl_certificate API call to work.
i keep getting:
Code:
"This certificate cannot be parsed. It may be corrupt or in an unrecognized format."
Here is what i've got so far:
Code:
#!/usr/bin/perl
use strict;
use LWP::UserAgent;
use LWP::Protocol::https;
my $hash = qx(cat /root/.accesshash | tr -d "\n");
my $auth = "WHM root:" . $hash;
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;
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=-----BEGIN CERTIFICATE----- CERT GOES HERE -----END CERTIFICATE-----&key=-----BEGIN RSA PRIVATE KEY----- KEY GOES HERE -----END RSA PRIVATE KEY-----" );
$request->header( Authorization => $auth );
my $response = $ua->request($request);
print $response->content;
Let's say for example I have a key that reads as such:
Code:
-----BEGIN CERTIFICATE-----
DFGDFGDFGDFGDFGDFGDFGDFGDFGDFG
QWEQWEQWEQWEQWEQWEQWEQWEQ
ZXCZXCZXCZXCZXCZXCZXCZXCZXCZXC
-----END CERTIFICATE-----
If possible, I would appreciate if someone could point out where the xml vs json differences would be here, as well.
Anyways, Thank y'all VERY much for your time and help in advance. : )