aXAPI certificate upload not working
SuryaA10
Member ✭
Hellom
I am trying to upload certificate using aXAPI REST Interface.I am using CXF util for Rest interaction.I have written following code.
If not then can you please paste your code(In whatever language) so that i can check what i am missing
NOTE : If i don't include attachment i am getting response from Server.But when i add some attachment it will give 400 error.
I am trying to upload certificate using aXAPI REST Interface.I am using CXF util for Rest interaction.I have written following code.
final String URL = "https://XXXXXXXXXXXX/services/rest/V2/?session_id=XXXXXXX&method=slb.ssl.upload&type=cert"; WebClient client = WebClient.create(URL); client.type("multipart/form-data"); ContentDisposition cd = new ContentDisposition("attachment;filename=certfile"); List<Attachment> atts = new LinkedList<Attachment>(); InputStream stream = new FileInputStream("D:\\certfile"); Attachment att = new Attachment("root", stream, cd); atts.add(att); Response response = client.post(new MultipartBody(att));It gives me 400 error.Anyone else here faced this problem?
If not then can you please paste your code(In whatever language) so that i can check what i am missing
NOTE : If i don't include attachment i am getting response from Server.But when i add some attachment it will give 400 error.
Tagged:
0
Comments
session_id=xxxxxxxxxxxxxxxxxxxx&method=slb.ssl.upload&type=crl
If this is still a problem after my recommended fix above, can you provide a complete xml/jason dump so we can debug the problem.
Otherwise, if you fix the problem please post the fix for future vADC reference.
Regards,
Genard
as an example: upload certificate “ca2_1.crt.pem” to Thunder use CURL
curl -F upload=@ca2_1.crt.pem -k https://$ip/services/rest/V2.0/?session_id=$session\&format=json\&method=slb.ssl.upload\&type=certificate
I have attached additional shell script in this thread to fix your ssl upload problem. Change the certificate name match your environment.
Run the script like this: ./ssl-upload.sh
For example: ./ssl-upload.sh 10.100.2.70