I'm trying to use the API to import a new TLS certificate for the WebGUI.
I keep getting:
HTTP 500
{"errorMessage":"Invalid private key provided: cannot parse private key data","errorTitle":"Certificate error"}
The certificate is an EC certificate that is accepted manually by the GUI, but is there something in the API that wont accept an EC private key?
e.g.: -----BEGIN EC PRIVATE KEY-----
I've got a feeling this will work with an RSA certificate, but as I don't have one, its hard to test.
TIA
Ahhh, solved. It was the \r \n formatting in the key.
Got it working now
$keyPem = (Get-Content -Raw $PrivKeyPath) -replace "`r`n","`n"