Github user ted-ross commented on a diff in the pull request:
https://github.com/apache/qpid-dispatch/pull/124#discussion_r92030610
--- Diff: src/connection_manager.c ---
@@ -176,6 +176,46 @@ static void set_config_host(qd_server_config_t
*config, qd_entity_t* entity)
assert(config->host);
}
+static char* qd_config_ssl_profile_get_password(qd_config_ssl_profile_t*
ssl_profile)
+{
+ char *pw = ssl_profile->ssl_password;
+ if (!pw) return pw;
+
+ /* if the "password" starts with "env:" or "env: " then the remaining
+ * text is the environment variable that contains the password
+ */
+ if (strncmp(pw, "env:", 4) == 0) {
+ char *env = pw + 4;
+ /* skip the space if it is there */
+ if (*env == ' ') ++env;
+
+ const char* passwd = getenv(env);
+ if (passwd) {
+ free(ssl_profile->ssl_password);
+ pw = ssl_profile->ssl_password = strdup(passwd);
+ } else {
+ qd_error(QD_ERROR_NOT_FOUND, "Failed to find a password in the
environment variable '%s'", env);
--- End diff --
This should definitely be logged. It might be prudent to not include the
password text in the log though.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]