Skip to content

Commit

Permalink
lib-ldap: Set minimum protocol if supported by library
Browse files Browse the repository at this point in the history
  • Loading branch information
cmouse authored and sirainen committed Apr 29, 2016
1 parent ea3a3b6 commit a17f068
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib-ldap/ldap-connection.c
Expand Up @@ -55,10 +55,11 @@ int ldap_connection_setup(struct ldap_connection *conn, const char **error_r)
}

ldap_set_option(conn->conn, LDAP_OPT_X_TLS, &opt);
#ifdef LDAP_OPT_X_TLS_PROTOCOL_MIN
/* refuse to connect to SSLv2 as it's completely insecure */
opt = LDAP_OPT_X_TLS_PROTOCOL_SSL3;
ldap_set_option(conn->conn, LDAP_OPT_X_TLS_PROTOCOL_MIN, &opt);

#endif
opt = conn->set.timeout_secs;
/* default timeout */
ldap_set_option(conn->conn, LDAP_OPT_TIMEOUT, &opt);
Expand Down

0 comments on commit a17f068

Please sign in to comment.