openldap: implement STARTTLS

As this introduces use of CURLOPT_USE_SSL option for LDAP, also check
this option in ldap.c as it is not supported by this backend.

Closes #8065
This commit is contained in:
Patrick Monnerat 2021-11-30 17:48:28 +01:00 committed by Daniel Stenberg
parent a6e2643433
commit a40160aee8
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 83 additions and 10 deletions

View file

@ -464,6 +464,11 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done)
#endif
#endif /* CURL_LDAP_USE_SSL */
}
else if(data->set.use_ssl > CURLUSESSL_TRY) {
failf(data, "LDAP local: explicit TLS not supported");
result = CURLE_NOT_BUILT_IN;
goto quit;
}
else {
server = ldap_init(host, (int)conn->port);
if(!server) {