1--TEST--
2ldap_set_option() - Basic test for TLS CRL check ldap option
3--CREDITS--
4Chad Sikorra <Chad.Sikorra@gmail.com>
5--EXTENSIONS--
6ldap
7--SKIPIF--
8<?php
9    require "connect.inc";
10    $link = ldap_connect($uri);
11    ldap_get_option($link, LDAP_OPT_X_TLS_PACKAGE, $package);
12    if ($package != 'OpenSSL') {
13        die("skip OpenSSL required for CRL check options, got: $package");
14    }
15?>
16--FILE--
17<?php
18require "connect.inc";
19$link = ldap_connect($uri);
20
21foreach([
22    LDAP_OPT_X_TLS_CRL_NONE,
23    LDAP_OPT_X_TLS_CRL_PEER,
24    LDAP_OPT_X_TLS_CRL_ALL,
25] as $option) {
26    $result = ldap_set_option($link, LDAP_OPT_X_TLS_CRLCHECK, $option);
27    var_dump($result);
28
29    ldap_get_option($link, LDAP_OPT_X_TLS_CRLCHECK, $optionval);
30    var_dump($optionval);
31}
32?>
33--EXPECT--
34bool(true)
35int(0)
36bool(true)
37int(1)
38bool(true)
39int(2)
40