Return all SSL certificate components on vhost

This function lists the components of each SSL certificate on the server's virtual hosts.

Warning:

  • On most servers, this function returns a large amount of output. We strongly recommend that you filter and sort the output.

  • The following example uses the filter and sort options:

    https://hostname.example.com:2087/cpsess##########/json-api/fetch_vhost_ssl_components?api.version=1&api.filter.a.field=servername&api.filter.a.arg0=servername.com&api.filter.a.type=eq&api.filter.enable=1&api.sort.enable=1&api.sort.a.field=servername

SecurityBasicAuth
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
object
get/fetch_vhost_ssl_components
Request samples
whmapi1 --output=jsonpretty \
  fetch_vhost_ssl_components
Response samples
application/json
{
  • "data": {
    • "components": [
      • {
        • "cabundle": null,
        • "cabundle_id": null,
        • "certificate": "-----BEGIN CERTIFICATE-----\nMIIDcTCCAlmgAwIBAgIFAc/XZhswDQYJKoZIhvcNAQELBQAwFTETMBEGA1UEAwwK\ncmVzZWxsLmNvbTAeFw0xOTEyMjMxNjEwMDNaFw0yMDEyMjIxNjEwMDNaMBUxEzAR\nBgNVBAMMCnJlc2VsbC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB\nAQDs/rUGLbn4z7PeU7jMH1LeOYGc9omIATsxFwkRJUr7khxDZd59MYm2NzwLf1X2\n7ccYqYGbqjlwwpCWTrWvS9vAmrFqAr+5xp30w3bVhKrE9K+tYfUb4MbY0N/Cu0Hf\nOiSDbo07SAoOrGMHVVaPINNs1+eQ5sRxsJYBz//tOUYEJlrQAPttiHb3sk6J13Vv\nWArtk5+Q7L4lLKSxtPjQmwy/1hU2SRr0tmVkIaH77iOOMWvwB2pIYsRYjKujp0eE\ngo7FdhUIBCJ7+ZqabZHGGpm/UQ+jveI83qqB/xHD4ZxAX7GKUyHGzp8XyIPTFLNq\nAaGWN8Kv80+DZk2my78vFcjfAgMBAAGjgccwgcQwHQYDVR0OBBYEFHIsjBLssrvL\n+K0pebUQE3HYyIxFMAkGA1UdEwQCMAAwQQYDVR0jBDowOIAUciyMEuyyu8v4rSl5\ntRATcdjIjEWhGaQXMBUxEzARBgNVBAMMCnJlc2VsbC5jb22CBQHP12YbMB0GA1Ud\nJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjA2BgNVHREELzAtggpyZXNlbGwuY29t\ngg9tYWlsLnJlc2VsbC5jb22CDnd3dy5yZXNlbGwuY29tMA0GCSqGSIb3DQEBCwUA\nA4IBAQAP6DKtvvr5SQGqxPTaYraq3PU6AWJGSJwFEI4LiUauyNnXMrox4a5Mi3Bl\nOoxEoyW9Br9S6HQ7Ta0kLppcPl6RTuvJljady5feMiCSYaz59XYB5Bo8vTl7Qn7u\nq2UsLqo9qroCpF+qdmbsqR8kFUltjycnVZ8g21Hu2QoeyOKEbuzohy5mtffchoV8\nzsifokwid0f+Zd88oYPQNNPib2P9Ef06DUHy2hBBe0Wunh2McjYckRTdYgIPVANj\n0DhtCcD76Q1VtmjkReirj4CY63/8wcQ2wk37qtUI5x2SzMIAuv49HAwD7atwQKgZ\n03hIrdHhFSIwTJMG1nqyO+h3X5En\n-----END CERTIFICATE-----",
        • "certificate_id": "example_com_ecfeb_5c8df_1608653403_1de5d524f287f7ec75531239a2f4a133",
        • "key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpgIBAAKCAQEA7P61Bi25+M+z3lO4zB9S3jmBnPaJiAE7MRcJESVK+5IcQ2Xe\nfTGJtjc8C39V9u3HGKmBm6o5cMKQlk61r0vbwJqxagK/ucad9MN21YSqxPSvrWH1\nG+DG2NDfwrtB3zokg26NO0gKDqxjB1VWjyDTbNfnkObEcbCWAc//7TlGBCZa0AD7\nbYh297JOidd1b1gK7ZOfkOy+JSyksbT40JsMv9YVNkka9LZlZCGh++4jjjFr8Adq\nSGLEWIyro6dHhIKOxXYVCAQie/mamm2RxhqZv1EPo73iPN6qgf8Rw+GcQF+xilMh\nxs6fF8iD0xSzagGhljfCr/NPg2ZNpsu/LxXI3wIDAQABAoIBAQDEBRA5YgzWDQVa\nuKi6vJXQFIRuDURH56zLt5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CCBOYi22JiECcXQusWiI8PIT\nyxRAxIGZ6PY6ks3AEQhb9/oWSd9RVuXsflx01SFkpRIbSNwVWhLqr9HvfmpsZw2S\n5TTdqv/VaEByFDKJSIKnKk4e6rxa2XF6YxUEvZ59Bw3iP2fpksBG/nTu\n-----END RSA PRIVATE KEY-----",
        • "key_id": "ecfeb_5c8df_35927dbac0386ff253c269a9cda4c6f3",
        • "servername": "example.com"
        }
      ]
    },
  • "metadata": {
    • "command": "fetch_vhost_ssl_components",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}