1--TEST--
2ldap_set_option() - Basic test for TLS protocol min ldap option
3--CREDITS--
4Chad Sikorra <Chad.Sikorra@gmail.com>
5--EXTENSIONS--
6ldap
7--SKIPIF--
8<?php
9if (!defined("LDAP_OPT_X_TLS_PROTOCOL_MAX")) {
10    die('skip LDAP_OPT_X_TLS_PROTOCOL_MAX unsupported.');
11}
12?>
13--FILE--
14<?php
15require "connect.inc";
16$link = ldap_connect($uri);
17
18foreach([
19    LDAP_OPT_X_TLS_PROTOCOL_SSL2,
20    LDAP_OPT_X_TLS_PROTOCOL_SSL3,
21    LDAP_OPT_X_TLS_PROTOCOL_TLS1_0,
22    LDAP_OPT_X_TLS_PROTOCOL_TLS1_1,
23    LDAP_OPT_X_TLS_PROTOCOL_TLS1_2,
24    LDAP_OPT_X_TLS_PROTOCOL_TLS1_3,
25] as $option) {
26    $result = ldap_set_option($link, LDAP_OPT_X_TLS_PROTOCOL_MIN, $option);
27    var_dump($result);
28
29    ldap_get_option($link, LDAP_OPT_X_TLS_PROTOCOL_MIN, $optionval);
30    var_dump($optionval);
31}
32?>
33--EXPECT--
34bool(true)
35int(512)
36bool(true)
37int(768)
38bool(true)
39int(769)
40bool(true)
41int(770)
42bool(true)
43int(771)
44bool(true)
45int(772)
46