Signing Service Not Available

Question:

I’m trying to setup a signing service to use with digital signatures. I’m receiving a 500 - Signing service not available error. My SIGNING_SERVICE_URL is pointed at http://localhost:6000/sign and I can confirm that the signing service is up and running. What should I do?

Answer:

If you’re developing your own signing service or running our signing service reference implementation, you need to make sure that you can run the signing service as a sibling container to PSPDFKit Document Engine in the same network.

The simplest way to have things working together is to use a specific directory structure and a unified docker-compose.yml file, so that your application and the signing service sit side by side with the docker-compose.yml definition.

.
├── docker-compose.yml
├── my-app
└── signing-service

The Docker Compose file should have a structure with all 3 services:

services:
  pspdfkit:
    ...
    environment:
      SIGNING_SERVICE_URL: http://signing_service:6000/sign
    depends_on:
      - signing_service
  signing_service:
    build: ./signing-service
    ...
  my_app:
    build: ./my-app
    ...
    depends_on:
      - pspdfkit

Finally, when specifying the SIGNING_SERVICE_URL in your PSPDFKit Document Engine configuration, the URL host has to point to a location reachable by the PSPDFKit Document Engine container.

For this reason, using a URL pointing to localhost cannot work: the PSPDFKit Document Engine container resolves localhost to itself, not to the host machine running the signing service. Instead, the SIGNING_SERVICE_URL should point at the signing_service container.