How to upload SSL certificate from linux CLI. |VMware Communities

I am trying to upload a SSL certificate using the instructions provided at Replace a Default Certificate Using HTTPS PUT

I need to do this from command line and so am attempting to use curl to upload the file and it is failing.


# curl –upload-file vmwareesxi.example.org.cer https://vmwareesxi.example.org/host/ssl_cert -u root –insecure -v

Enter host password for user ‘root’:

* TLSv1.3 (OUT), TLS handshake, Client hello (1):

* TLSv1.3 (IN), TLS handshake, Server hello (2):

* TLSv1.2 (IN), TLS handshake, Certificate (11):

* TLSv1.2 (IN), TLS handshake, Server key exchange (12):

* TLSv1.2 (IN), TLS handshake, Server finished (14):

* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):

* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):

* TLSv1.2 (OUT), TLS handshake, Finished (20):

* TLSv1.2 (IN), TLS handshake, Finished (20):

> PUT /host/ssl_cert HTTP/1.1

> Host: vmwareesxi.example.org

> Authorization: Basic <removed>

> User-Agent: curl/7.66.0

> Accept: */*

> Content-Length: 1935

> Expect: 100-continue


< HTTP/1.1 403 Forbidden

< Date: Sun, 29 Sep 2019 22:00:39 GMT

< Set-Cookie: vmware_soap_session=”3032fd1f05309111aaa45f7a0e7c0c38980649da”; Path=/; HttpOnly; Secure;

< Connection: close

< Content-Security-Policy: block-all-mixed-content

< Content-Type: text/plain; charset=utf-8

< Strict-Transport-Security: max-age=31536000

< X-Content-Type-Options: nosniff

< X-Frame-Options: DENY

< X-XSS-Protection: 1

< Content-Length: 0


* TLSv1.2 (OUT), TLS alert, close notify (256):


If I look at logs on the ESXi host I see that I successfully logged in.  But cannot find anything else in any of the logs to suggest what I should do.


2019-09-29T22:05:30.758Z info hostd[2099262] [Originator@6876 sub=Default] Accepted password for user root from 192.168.xx.yy

2019-09-29T22:05:30.759Z info hostd[2099262] [Originator@6876 sub=Vimsvc.ha-eventmgr] Event 108 : User root@192.168.xx.yy logged in as curl/7.66.0


Can anyone help?


Thank you



PS… I changed my URL, IP address and hashed password above.

Source link


To see the full content, share this page by clicking one of the buttons below

Related Articles

Leave a Reply