Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not update ssl #15

Open
simanchou opened this issue Mar 15, 2022 · 1 comment
Open

can not update ssl #15

simanchou opened this issue Mar 15, 2022 · 1 comment

Comments

@simanchou
Copy link

sfb, err := ioutil.ReadFile("mydomain.com.cer")
sslFile := &system.Systemfile{
Filename: "mydomain.com.20220315.cer",
Filecontent: base64.StdEncoding.EncodeToString(sfb),
Filelocation: "/nsconfig/ssl/",
Fileencoding: "BASE64",
}
addResp, err := client.AddResource(service.Systemfile.Type(), "mydomain.com.20220315.cer", sslFile)

upload file successful, and i can find the file in web GUI.

sslUpdateReq := &ssl.Sslcertkey{
Certkey: "mydomain.com",
// Cert: "/nsconfig/ssl/mydomain.com.20220315.cer", still fail
Cert: "mydomain.com.20220315.cer",
Nodomaincheck: true,
}

updateResp, err := client.UpdateResource(service.Sslcertkey.Type(), "mydomain.com", sslUpdateReq)

2022/03/15 10:41:35 [ERROR] nitro-go: Failed to update resource of type sslcertkey, name=mydomain.com err=failed: 599 Netscaler specific error ({ "errorcode": 278, "message": "Invalid argument [cert]", "severity": "ERROR" })

update ssl fail, how can i define the cert argument?

BTW, i can update the ssl with the file upload above in web GUI, just fail by the SDK.

@jantytgat
Copy link

Hi simanchou, as far as I can tell, there is no API available to upload a file to the ADC.
If you run developer tools in the web GUI, you will see they call an internal /rapi endpoint instead of the normal /api.

It seems that one is only callable through the GUI, unfortunately.
(I've been looking for this for ages myself, and the only way so far is through SSH).

You can download files however, but that is not of much use when you want to update a certificate file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants