NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform.
You will still be able to view content, but posting and replying will be temporarily disabled.
To learn more, please review the information in this blog post.

VMware Solutions Discussions

Upgrade certificate to CA

FilipS
5,810 Views

I'm trying to upgrade the self signed certificate of ONTAP Tools for vSphere version 10.4 to one signed by our internal MS CA.
When doing so, I receive the error The payload for POST request is invalid.
I already found KB: Unable to upgrade from certificate to CA in ONTAP Tools for VMware vSphere v10.3 - NetApp Knowledge Base

This however does not help.

 

1 ACCEPTED SOLUTION

ChanceBingen
4,669 Views

Hi, @FilipS 

I just got back into town after a bit of travel. Eyeballing your API calls, and comparing to my lab, it looks like you need to add the -H "x-auth: [JWT token]" with your JWT token from the output of your authentication. Like this:

 

curl -X POST "https://x.x.x.x:8443/virtualization/api/v1/commons/certificates" -H  "accept: application/json" -H  "x-auth: JWT_Token" -H  "Content-Type: application/json" -d "{\"cert\":\"string\"}"
 

View solution in original post

7 REPLIES 7

FilipS
5,807 Views

Here is a screenshot.

Untitled.png

ChanceBingen
5,755 Views

Interesting. I wonder if there is some kind of bug with the way the GUI takes the certificate contents and malforms the REST API.

 

Can you try using the REST API instead of the GUI?
https://<OTV.IP>:8443/#/Commons/virtualization__commonsAddCertificate

ChanceBingen
5,748 Views

If you do use the REST APIs, you will need to authenticate and get a token here:

https://<IP>:8443/#/Auth/virtualization__validateAdminLogin

FilipS
5,743 Views

Hmmm. I'm getting the following response:

{  "error": {    "code": "error_converting_input_to_certificate_request",    "message": "Error converting input to Certificate request",    "target": "Certificates"
  }
}

 

ChanceBingen
5,738 Views

I see, can you post the curl -X POST command generated by swagger? Alter the username/password/certificate for security.

FilipS
5,737 Views

Here you go.

 

Authentication:
curl -X POST "https://x.x.x.x:8443/virtualization/api/v1/auth/login" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"username\":\"Administrator\",\"password\":\"mypassword\"}"

 

Add certificate:

curl -X POST "https://x.x.x.x:8443/virtualization/api/v1/commons/certificates" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"cert\": \"mycert...\"}"

ChanceBingen
4,670 Views

Hi, @FilipS 

I just got back into town after a bit of travel. Eyeballing your API calls, and comparing to my lab, it looks like you need to add the -H "x-auth: [JWT token]" with your JWT token from the output of your authentication. Like this:

 

curl -X POST "https://x.x.x.x:8443/virtualization/api/v1/commons/certificates" -H  "accept: application/json" -H  "x-auth: JWT_Token" -H  "Content-Type: application/json" -d "{\"cert\":\"string\"}"
 
Public