Enable SSL for C/C++ SDK

This page explains how to configure the C/C++ Agent to connect to the Controller using SSL.

To enable the SSL on the C/C++ Agent:

  1. Open your application to the file where you configure the Controller settings.
  2. Set const int CONTROLLER_USE_SSL = 1;.
  3. In the appd_config struct, include the following method:
    appd_config_set_controller_use_ssl(cfg, CONTROLLER_USE_SSL);
  4. If you are using a self-signed certificate, you must do the following:
    1. Get the Controller certificate by running the following command:
      openssl s_client -connect <hostname>:<port> -showcerts < /dev/null | openssl x509 > cert.pem
    2. Update the certificate_file
      appd_config_set_controller_certificate_file(cfg, <Path to Cert File>);
  5. You can check the CommonName by running the following command:
    openssl s_client -connect <CONTROLLER_HOST>:<CONTROLLER_PORT> -showcerts
    The CommonName appears above the BEGIN CERTIFICATE line.The certificate CommonName must match the Controller hostname. If they do not match, you must re-configure the certificate on the Controller.