我有一个 vCenter Server 5.5 版。我正在尝试使用以下命令生成会话 ID 以对 ReST API 请求进行身份验证:
curl -kv -X POST -H 'Accept: application/json' --basic -u me@abc.co.in:myPass! $VCENTER/rest/com/vmware/cis/session
其中 $VCENTER= https://vc
这是我得到的输出
* Hostname was NOT found in DNS cache
* Trying 1.2.3.4...
* Connected to vc (1.2.3.4) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using AES256-SHA
* Server certificate:
* subject: O=VMware, Inc.; OU=vCenterServer_2014.12.24_203443; CN=VMware default certificate; emailAddress=support@vmware.com
* start date: 2014-12-24 04:44:30 GMT
* expire date: 2024-12-22 04:44:32 GMT
* issuer: O=VMware, Inc.; OU=vCenterServer_2014.12.24_203443; CN=VC.xyz.co.in; emailAddress=support@vmware.com
* SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
* Server auth using Basic with user 'me@xyz.co.in'
> POST /rest/com/vmware/cis/session HTTP/1.1
> Authorization: Basic YWthbmtzaGFfamFpbkBwZXJzaXN0ZW50LmNvLmluOmFra2FTZXAyMDE3IQ==
> User-Agent: curl/7.35.0
> Host: pt-vc
> Accept: application/json
>
< HTTP/1.1 400 Bad Request
< Date: Thu, 13 Jul 2017 09:33:40 GMT
< Connection: close
< Content-Type: text; charset=plain
< Content-Length: 0
<
* Closing connection 0
* SSLv3, TLS alert, Client hello (1):
查看输出,我不确定出了什么问题以及在哪里。这是因为我的密码有一个!
需要转换为十六进制等价物的密码吗?