/api/cert/upload-key
Use this interface to upload certificate private key.
System configuration editing permissions are required.
Prototype
Protocol | HTTP/HTTPS POST |
URL | ip[:port]/api/cert/upload-key |
Content-Type | Request: Content-Type: multipart/form-data Response: Content-Type: application/json |
Request Cookies
Parameter | Description |
---|---|
mwcloud-sid | A string that is used to identify current logged-in user. |
mwcloud-uid | Current logged-in username. |
Request Body
The form method uses the multipart/form-data type to encapsulate and submit the certificate file.
Request Example
POST /api/cert/upload-key HTTP/1.1
Content-Type: multipart/form-data; boundary=---------------------------22383205084807890342375037721
Content-Length: 1920
Cookie: mwcloud-sid=OCXWUMGEYPGIAWWOETYXPNMVHDZIAZJP; mwcloud-uid=Admin;
-----------------------------22383205084807890342375037721
Content-Disposition: form-data; name="file"; filename="cloudserver.pem"
Content-Type: application/octet-stream
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAxuYuD0+i1XNHvTRV+2HLltNUNuiA15gh+OAGwJ7yhsXLrtEg
EMCbETTvTzMEgEfH1ya3fPKywDeO84VT6/RId6OtZY6RC/pDayRenQhABgQQe2l6
...
aoMgVhx+L+FFm9wgKHnZrLVRjN+Z26GLXWkkkSGaoJAAIMxPPy44Jg==
-----END RSA PRIVATE KEY-----
-----------------------------22383205084807890342375037721--
Response Parameters
Response Header
Parameter | Description |
---|---|
Content-Type | Value: 'application/json; charset=UTF-8' |
Response Body
Parameter | Description |
---|---|
result | Result code |
filename | File name |
Response Example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: xxx
{
"result": 0,
}