Developer

 View Only
last person joined: 3 days ago 

Expand all | Collapse all

Upload certificate to Mobility Conductor / Controllers

This thread has been viewed 18 times
  • 1.  Upload certificate to Mobility Conductor / Controllers

    Posted 10 days ago

    I'm using the REST API for Mobility Master, trying to automate cert-renewal.

    I am able to get a list of existing certificates, but when I try to use post, it doesn't work.

    I'm using this API request:

    https://mobilitymaster:4343/v1/configuration/object/crypto_local_pki_cert?config_path=%2Fmd%2FLocation%2F00:00:00:00:00:00

    body = {'cert_type':"ServerCert","name":"testcert","filename":"certificate.pfx"}

    However, the certificate itself is not attached to this request, and I don't know how to add it.



  • 2.  RE: Upload certificate to Mobility Conductor / Controllers

    MVP GURU
    Posted 10 days ago

    What the API swagger about body ? because i think you need to "upload" the certificate 



    ------------------------------
    PowerArubaSW : Powershell Module to use Aruba Switch API for Vlan, VlanPorts, LACP, LLDP...

    PowerArubaCP: Powershell Module to use ClearPass API (create NAD, Guest...)

    PowerArubaCL: Powershell Module to use Aruba Central

    PowerArubaCX: Powershell Module to use ArubaCX API (get interface/vlan/ports info)..

    ACEP / ACMX #107 / ACDX #1281
    ------------------------------



  • 3.  RE: Upload certificate to Mobility Conductor / Controllers

    Posted 7 days ago

    Do you mean the https://mobilitymaster:4343/api/ documentation thing?

    It only says this:
    {
      "cert_type": "ServerCert",
      "name": "string",
      "filename": "string"
    }

    But the filename parameter is just a string, it is not the file itself. 




  • 4.  RE: Upload certificate to Mobility Conductor / Controllers

    MVP GURU
    Posted 7 days ago

    Hi,

    I think filename is the payload of file (using base64 encoding ?)

    What do you have when make a get ?



    ------------------------------
    PowerArubaSW : Powershell Module to use Aruba Switch API for Vlan, VlanPorts, LACP, LLDP...

    PowerArubaCP: Powershell Module to use ClearPass API (create NAD, Guest...)

    PowerArubaCL: Powershell Module to use Aruba Central

    PowerArubaCX: Powershell Module to use ArubaCX API (get interface/vlan/ports info)..

    ACEP / ACMX #107 / ACDX #1281
    ------------------------------



  • 5.  RE: Upload certificate to Mobility Conductor / Controllers

    Posted 7 days ago

    There is a limit on how long the string can be, so base64 would be too much:
    "Error : Expecting string of length 1 to 31"

    Here's the output for get:

      '_data': {  'crypto_local_pki_cert': [  {  '_flags': {  'default': True,
                                                               'inherited': True},
                                                  'cert_type': 'PublicCert',
                                                  'filename': 'master-ssh-pub-cert',
                                                  'name': 'master-ssh-pub-cert'},
                                               {  'cert_type': 'ServerCert',
                                                  'filename': 'mobility-ctrl01.pfx',
                                                  'name': 'mobility-ctrl01'}]}}