Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-1935

[cpp] Read a config file to get default connection parameters

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: proton-c-0.25.0
    • Fix Version/s: proton-c-0.26.0
    • Component/s: cpp-binding
    • Labels:
      None

      Description

      Implement no-argument C++ connect() to connect using information loaded from a config file located and formatted as follows:
       

      # Connection Configuration {#connect_config}
      
      Proton clients can read default connection information from a
      configuration file.
      
      If the environment variable `MESSAGING_CONNECT_FILE` is set, it is the
      path to the file. Otherwise the client looks for a file named
      `connect.json` in the following locations, using the first one found:
      
      * Current working directory of client process.
      * `$HOME/.config/messaging/` - $HOME is user's home directory.
      * `/etc/messaging/`
      
      The configuration file is in JSON object format. Comments are allowed,
      as defined by the [JavaScript Minifier](https://www.crockford.com/javascript/jsmin.html)
      
      The file format is as follows. Properties are shown with their default
      values, all properties are optional.
      
          {
              "scheme": "amqp",    // [string] URL scheme for connection. Use "amqps" for a TLS connection.
              "host": "localhost", // [string] DNS or IP address for connection.
              "port": "amqp",      // [string] Defaults to be the same as the scheme.
              "user": null,        // [string] Authentication user name
              "password": null,    // [string] Authentication password
              "sasl": {
                  "enable": true,         // [boolean] Enable/disable SASL authentication
                  "mechanisms": null,     // [list] List of SASL mechanism names. If null the library determines the default list.
                  "allow_insecure": false // [boolean] Allow mechanisms that send clear-text passwords, even on an unencrypted connection.
              }
              "tls": {
                  // NOTE: This section is not final and will change.
                  "enable": true,                      // boolean (true)
                  "pem_cert_store": null,              // string [file or dir or ?] (null)
                  "pem_ca_cert_store": null,           // string [file or dir or ?] (null)
                  "pem_key_file": null,                // string file path (null)
                  "pkcs12_key_store": null,            // string (null)
                  "pkcs12_trust_store": null,          // string (null)
                  "key_password": null,                // string (null)
                  "verify_hostname": true              // boolean (true)
              },
          }

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                aconway Alan Conway
                Reporter:
                aconway Alan Conway
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: