Ran into an interesting problem today:
I was trying to import a certificate into my controllers (ArubaOS 8.5.0.6) and no matter what format I chose (DER, PFX, PEM, etc.) it would always give the error "Error Uploading Certificate: Error : Expecting string of length 1 to 31".
Turns out the certificate filename was too long. I just had to shorten it and the PFX imported no problem. Hope this helps others!