Skip to content

Use CURLOPT_SSL_CTX_FUNCTION for LDAPS connections #4108

@apique13

Description

@apique13

I did this

Hello,
I'm using libcurl to manage HTTP(S), IMAP(S), POP(S), SMTP(S) and LDAP(S) connections.
I'm using CURLOPT_SSL_CTX_FUNCTION and CURLOPT_SSL_CTX_DATA to initialize the list of trusted certificates for SSL. I manage myself the certificates and permits to the user to accept them with in-memory certificates.
It works perfectly for HTTP and Mails, but it has no effect for LDAPS connections.
It seems that only certificate files can be used.
I saw in ldap.c that on Windows, openldap is not used, so I tried on Linux to be sure, but only few parameters like cafile and verifypeer are used.

I expected the following

I think CURLOPT_SSL_CTX_FUNCTION (fsslctx) could defines LDAP_OPT_X_TLS_CONNECT_CB
and CURLOPT_SSL_CTX_DATA (fsslctxp) could defines LDAP_OPT_X_TLS_CONNECT_ARG.
Thanks in advance.

curl/libcurl version

7.65.1

operating system

Linux (but if we could compile libcurl against openldap instead of WIN32_LDAP on Windows, it would be great too)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions