The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

json api call with cpanel for ssl details

Discussion in 'cPanel Developers' started by amvis, Jun 11, 2014.

  1. amvis

    amvis Registered

    Joined:
    Jun 11, 2014
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    i have installed the ssl certificate in client account and have been trying to call the json api from rails to get the response from SSL::listcrts, but i am getting the response is

    "{\"cpanelresult\":{\"func\":\"listcrts\",\"apiversion\":2,\"module\":\"SSL\",\"data\":[],\"event\":{\"result\":1}}}\n",

    but i can see that ssl certificate details in user's cpanel. why here the host is null?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Could you provide more details on how you are utilizing the SSL::listcrts API2 function? How does it look in your application?

    Thank you.
     
  3. amvis

    amvis Registered

    Joined:
    Jun 11, 2014
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    These are the three calls, which calling the SSL::listkeys,SSL::listcsrs,SSL::listcrts

    IP:2086/json-api/cpanel?user=sslacnt&cpanel_jsonapi_module=SSL&cpanel_jsonapi_func=listkeys&cpanel_jsonapi_version=2
    IP:2086/json-api/cpanel?user=sslacnt&cpanel_jsonapi_module=SSL&cpanel_jsonapi_func=listcsrs&cpanel_jsonapi_version=2
    IP:2086/json-api/cpanel?user=sslacnt&cpanel_jsonapi_module=SSL&cpanel_jsonapi_func=listcrts&cpanel_jsonapi_version=2

    Here in the three cases, i have got the details from keys and csrs but not from crts?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    If you are using WHM, you could try using WHM API 1. EX:

    Code:
    hxxp://example.com:2086/cpsess123456789/json-api/fetchsslinfo?api.version=1&domain=test-domain.com
    Or, with cPanel, you could try using UAPI. EX:

    Code:
    hxxp://example.com:2086/cpsess123456789/execute/SSL/list_certs
    A full list of SSL options with UAPI are available at:

    UAPI - SSL

    Thank you.
     
Loading...

Share This Page