Hi,
I'm trying to use the salt-api. I have salt 0.15.1 and salt-api 0.8.1. In my master config file I have:
external_auth:
pam:
jmb:
- .*
root:
- .*
rest_cherrypy:
port: 8000
debug: True
I start the salt-master and the salt-api and try to connect with curl:
>
curl -i
http://localhost:8000HTTP/1.1 401 Unauthorized
Content-Length: 57
Vary: Accept-Encoding
Server: CherryPy/3.2.2
Allow: GET, HEAD, POST
Date: Wed, 12 Jun 2013 23:35:45 GMT
Content-Type: application/json
Www-Authenticate: Session
Set-Cookie: session_id=d327d6d347e6d9005ade52fab8977a51268babb1; expires=Thu, 13 Jun 2013 09:35:45 GMT; Path=/
{"status": "401 Unauthorized", "return": "Please log in"}
I get the same error trying to use my web browser.
If I enable ssl in my master config file:
external_auth:
pam:
jmb:
- .*
root:
- .*
rest_cherrypy:
port: 8000
ssl_crt: /etc/pki/tls/certs/localhost.crt
ssl_key: /etc/pki/tls/certs/localhost.key
And then try connecting I get:
curl -i
https://localhost:8000curl: (60) Peer certificate cannot be authenticated with known CA certificates
More details here:
http://curl.haxx.se/docs/sslcerts.htmlcurl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
So, I do:
> salt '*' tls.create_self_signed_cert
I still can't use curl to connect:
> curl -i
https://localhost:8000curl: (60) Peer certificate cannot be authenticated with known CA certificates
More details here:
http://curl.haxx.se/docs/sslcerts.htmlcurl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
So, I try this:
> curl -u root -i
https://localhost:8000 Enter host password for user 'root':
curl: (6) Couldn't resolve host 'jmb'
curl: (60) Peer certificate cannot be authenticated with known CA certificates
More details here:
http://curl.haxx.se/docs/sslcerts.htmlcurl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
No matter what I enter for the password it fails.
Can someone help me figure out what I'm doing wrong?
Thanks!