spring-cloud-samples / bookstore-service-broker

Sample application for Spring Cloud Open Service Broker
https://spring.io/projects/spring-cloud-open-service-broker
Apache License 2.0
72 stars 60 forks source link

Unauthorised error #12

Closed amitoj closed 6 years ago

amitoj commented 6 years ago

Following the guide to deploy the service broker to PCFDev (v0.29.0 and v0.30.0) running on Linux. I am not getting the response as expected.

curl https://bookstore-service-broker.local.pcfdev.io/v2/catalog -u admin:admin

curl: (35) You are attempting to import a cert with the same issuer/serial as an existing cert, but that is not the same cert.

curl with insecure setting, curl -k https://bookstore-service-broker.local.pcfdev.io/v2/catalog -u admin:admin

{"timestamp":"2018-05-01T12:36:33.811+0000","status":401,"error":"Unauthorized","message":"Unauthorized","path":"/v2/catalog"}

scottfrederick commented 6 years ago

The default password is supersecret, not admin (e.g. -u admin:supersecret).

I'll have to test with PCFDev and see if I can re-create the cert issue.

amitoj commented 6 years ago

Thanks @scottfrederick It's working with the password change and curl -k option. Would be nice to know how to resolve the cert issue.

scottfrederick commented 6 years ago

@amitoj PCF Dev creates self-signed SSL certs for the CF that it creates. This will normally require use of the curl -k parameter when hitting endpoints on any app deployed to PCF Dev, as the SSL certs won't be recognized by your local workstation.

As shown in the PCF Dev docs, you can add the PCF Dev self-signed SSL certs to your OS cert store to make them trusted by curl and other local tools. From You are attempting to import a cert with the same issuer/serial as an existing cert, but that is not the same cert. message you saw would lead me to believe that the PCF Dev self-signed SSL certs were imported into your OS cert store, but later the certificates changed (e.g. by destroying a PCF Dev and creating a new one).

These are all considerations of using PCF Dev, and would apply to any app deployed to that environment. This is not an issue with the service broker sample project.