Skip to content

Commit

Permalink
lib-dict: Add option to enforce SSL
Browse files Browse the repository at this point in the history
  • Loading branch information
cmouse committed Apr 13, 2016
1 parent 77475f6 commit ccaab3d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lib-dict/dict-ldap-settings.c
Expand Up @@ -209,6 +209,16 @@ parse_setting(const char *key, const char *value,
}
return NULL;
}
if (strcmp(key, "require_ssl") == 0) {
if (strcasecmp(value, "yes") == 0) {
ctx->set->require_ssl = TRUE;
} else if (strcasecmp(value, "no") == 0) {
ctx->set->require_ssl = FALSE;
} else {
return "require_ssl must be either yes or no";
}
return NULL;
}
break;
case SECTION_MAP:
return parse_setting_from_defs(ctx->pool,
Expand Down
1 change: 1 addition & 0 deletions src/lib-dict/dict-ldap-settings.h
Expand Up @@ -25,6 +25,7 @@ struct dict_ldap_settings {
unsigned int max_idle_time;
unsigned int debug;
unsigned int max_attribute_count;
bool require_ssl;
ARRAY(struct dict_ldap_map) maps;
};

Expand Down
1 change: 1 addition & 0 deletions src/lib-dict/dict-ldap.c
Expand Up @@ -160,6 +160,7 @@ int dict_ldap_connect(struct ldap_dict *dict, const char **error_r)
set.timeout_secs = dict->set->timeout;
set.max_idle_time_secs = dict->set->max_idle_time;
set.debug = dict->set->debug;
set.require_ssl = dict->set->require_ssl;
return ldap_client_init(&set, &dict->client, error_r);
}

Expand Down

0 comments on commit ccaab3d

Please sign in to comment.