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