How to upload a user certificate for RADIUS auth via cnMaestro

Note: If you prefer to upload a user certificate for RADIUS authentication via SNMP, this guide will be helpful.

Apart from SNMP method the certificate also can be uploaded as a template via cnMaestro.

For uploading a user certificate to ePMP SM device via cnMaestro it is required to put the the certificate’s content into json file and do some substitutions in it:

  • Replace non printable “new line” character (‘0xa0’) with its printable representation “\n” (“0x5c 0x6e”)

The simple python script would do all the replacements and create a proper json:

#!/usr/bin/python
import json

in_cert_file = 'user_cert.pem'
out_json_file = 'cert_processed.json'

with open(in_cert_file, 'r') as infile:
   cert_content = infile.read()

data = {
    "device_props": {
        "wirelessRadiusUser1Certificate": cert_content,
    },
}

with open(out_json_file, 'w') as outfile:
    json.dump(data, outfile, indent=4)

You need to put this script in a folder with user_cert.pem and run it. The output json file cert_processed.json will be created in the same folder.

The newly created JSON can be added to a template in cnMaestro using Select File button as shown in the picture below and then be applied to SM devices.

Tribute to @Simon_King for valuable remarks

2 Likes