]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openldap: fix STARTTLS
authorPatrick Monnerat <patrick@monnerat.net>
Sat, 30 Dec 2023 16:31:04 +0000 (17:31 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 31 Dec 2023 16:11:51 +0000 (17:11 +0100)
It was not working anymore since introduction of connection filters.

Also do not attempt to recover from a failing TLS negotiation with
CURLUSESSL_TRY.

Closes #12610

lib/openldap.c

index fcc9f91f44c3d9d9440192107eb8387a4f74ead0..171a4c3ce8c4497da8e7e8e51dbddb740ee3433f 100644 (file)
@@ -793,10 +793,13 @@ static CURLcode oldap_connecting(struct Curl_easy *data, bool *done)
         result = oldap_perform_bind(data, OLDAP_BIND);
       break;
     }
+    result = Curl_ssl_cfilter_add(data, conn, FIRSTSOCKET);
+    if(result)
+      break;
     FALLTHROUGH();
   case OLDAP_TLS:
     result = oldap_ssl_connect(data, OLDAP_TLS);
-    if(result && data->set.use_ssl != CURLUSESSL_TRY)
+    if(result)
       result = oldap_map_error(code, CURLE_USE_SSL_FAILED);
     else if(ssl_installed(conn)) {
       conn->bits.tls_upgraded = TRUE;