Accessing Veridata REST APIs over HTTPS

Steps to set up and run cURL command for SSL-enabled Veridata server:

  1. Navigate to veridata_installation_directory/config, ensure that the vdtWebKeystore.p12 file is present in this directory.
  2. Run the following commands:
    1. openssl pkcs12 -in vdtWebKeystore.p12 -nocerts -out server-key.pem
    2. openssl pkcs12 -in vdtWebKeystore.p12 -clcerts -nokeys -out server-cert.pem
  3. To generate the token to access the APIs, mention the path of the certificate generated in STEP 2, and run the following command:
    curl --cacert <path>/server-cert.pem https://localhost:8831/veridata/v1/auth/login -v --digest -u veridata:Welcome@123
  4. To run the APIs, run the following command using the token obtained in STEP 3:
    curl --cacert <path>/server-cert.pem --location --request GET 'https://localhost:8831/veridata/v1/services/configuration/profiles' --header 'Authorization: Bearer {{token}}'

All the cURL requests to the SSL-enabled server need to pass --cacert <path>.

Examples:

Create Connection
curl --cacert <path>/server-cert.pem --location  --request POST 'http://localhost:8831/veridata/v1/services/configuration/connections' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{token}}' \
--data '{
    "name": "JCT-D1",
    "host": "100.11.11.237",
    "port": "7890",
    "dbType": "ORACLE",
    "ssl": "false",
    "username": "ordsuser",
    "password": "oracle"
}'

Get Connection

curl --cacert <path>/server-cert.pem --location --request GET 'http://localhost:8831/veridata/v1/services/configuration/connections/1035' \
--header 'Authorization: Bearer {{token}}'