ldapsearch Size limit exceeded with paging and certificate
<p>I'm trying to execute a paginated ldapsearch to an LDAPs with a certificate:</p>

<pre><code>export LDAPTLS_CACERT=/home/test/ssl.pem
ldapsearch -x -H ldaps://test.test.com:636 -b "dc=test,dc=com" -E pr=100/noprompt
</code></pre>

<p>The above commands after 500 results, ldapsearch return <strong>Size limit exceeded</strong>: </p>

<pre><code>search: 6
result: 0 Success
control: 1.2.840.113556.1.4.319 false MA0CAQAECOYFAAAAAAAA
pagedresults: cookie=5gUAAAAAAAA=
# extended LDIF
#
# LDAPv3
# base &lt;dc=test,dc=com&gt; with scope subtree
# filter: (objectclass=*)
# requesting: ALL
# with pagedResults control: size=100
#

# search result
search: 7
result: 4 Size limit exceeded

# numResponses: 506
# numEntries: 500
</code></pre>

<p>But when I pass not only the certificate but also the username/password the things works perfectly:</p>

<pre><code>export LDAPTLS_CACERT=/home/test/ssl.pem    
ldapsearch -x -H ldaps://test.test.com:636 -b "dc=test,dc=com" \ 
-E pr=100/noprompt -D "cn=admin,dc=test,dc=com" -w myamazingpassword
</code></pre>

<p>The above commands after 1006 results, ldapsearch returns <strong>Success</strong>:</p>

<pre><code># search result
search: 12
result: 0 Success
control: 1.2.840.113556.1.4.319 false MAUCAQAEAA==
pagedresults: cookie=

# numResponses: 1017
# numEntries: 1006
</code></pre>

<p>Why is this happening? Why I'm not be able to perform paginated search on ldap without the username/password?</p>