Replies: 4 comments 11 replies
-
Replying to myself but perhaps Mandating a custom header for the API call is mandatory for "external" access |
Beta Was this translation helpful? Give feedback.
-
Curl seems to work now at least, although the browser doesn't but I'm guessing that the custom header is "required" for browsers but not things like curl so that might be the reason |
Beta Was this translation helpful? Give feedback.
-
I mentioned this, which is in System Configuration. But bo, typically you do not use a web browser to call a REST API, you typically want to prevent this in fact. |
Beta Was this translation helpful? Give feedback.
-
I hit the same issue. The answer was to add a hosts entry for the hostname youre using from other machines. So if you are resting to https:/my-ejbca.com/ejbca/.... then my-ejbca.com needs to be in the hosts file of the host of the ejbca, even if youre running ejbca from within a container. whats odd is that for signserver you dont need to do this. only for ejbca. the other oddity is the level of client authentication needed to consume ejbca rest services. some of the rest calls are read only e.g. retrieving cert chains for issued certs etc. IMO I should be able to consume these without authentication. Reading the ejbca doc about user authentication, it says to use the superadmin account for rest calls - maybe not! What I did instead was to create a new role that could only do "view end entities and certificates". I added a entity to that role and they could then consume rest to retrieve certs but do nothing else. What Im doing is signing code and retrieving back full certificate chain up to but not including the root ca. To do this I call the signserver rest call and get back the signature and the signer cert then I need to call the ejbca rest to retrieve the issuing CA cert. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using ejbca-ce inside a docker container. I've enabled all the services possible under the system configuration - protocols page and I seem to be able to access the rest API endpoints if I exec into the container and access it via localhost it works: For example
curl -s https://localhost:8443/ejbca/ejbca-rest-api/v1/certificate/status
However when I access it externally via the hostname, in a web browser like this:
https://myhostname.mydomainname:8443/ejbca/ejbca-rest-api/v1/certificate/status
It just returns "This service has been disabled." I am authenticated using an x509 cert. How do I enable external access as it doesn't appear to be obvious from the documenation? Thanks
Beta Was this translation helpful? Give feedback.
All reactions