Configuring custom certificate authority

Datasource requests

If you need to execute request to sources with custom authority then you need to configure the datasource container to use extra certificate. In Docker Compose deployments, it's essential to store the certificate as a file in the file system and then connect this file to the datasource container.

1. Place the necessary certificates in a directory linked as a volume for the datasource container. The following code example employs the ./ca directory.

2. Adjust the docker-compose.yaml file to enable the datasource container to link the ./ca directory as a volume:

  container_name: datasource
    - ./ca:/usr/datasource/ca

3. Utilize the provided certificate from the volume by setting it in the NODE_EXTRA_CA_CERTS environment variable:

  container_name: datasource    
    - NODE_EXTRA_CA_CERTS=/usr/datasource/ca/certificate.pem 

Other requests

If your Single Sign-On (SSO) services or OAuth sources require the use of a custom certificate authority, you need to configure the bakery-back service.

1. Create a custom keystore on your host machine

keytool -genkey -keyalg RSA -keystore mybakerystore.jks

2. Import your certificate into the keystore

keytool -import -trustcacerts -keystore mybakerystore.jks -alias mycert -file file.cer

3. Update your docker-compose.yml file to include a volume for the bakery-back service, enabling it to access the custom keystore:

    container_name: bakery-back
        condition: service_healthy
    restart: always
    env_file: .env
    - ./keystore_folder:/usr/bakery/keystore_folder

4. Modify .env file to include the following environment variable setting:


Last updated