1--TEST--
2ldap_option_reqcert_error() - A test to check if ldap can't connect to a LDAP server with a invalid certificate with certificate checking enabled
3--CREDITS--
4Edwin Hoksberg <edwin@edwinhoksberg.nl>
5--EXTENSIONS--
6ldap
7--SKIPIF--
8<?php
9    require_once __DIR__ .'/skipifbindfailure.inc';
10?>
11--FILE--
12<?php
13require "connect.inc";
14
15ldap_set_option(null, LDAP_OPT_X_TLS_REQUIRE_CERT, LDAP_OPT_X_TLS_HARD);
16
17$link = ldap_connect($host, $port);
18ldap_set_option($link, LDAP_OPT_PROTOCOL_VERSION, $protocol_version);
19
20var_dump(@ldap_bind($link, $user, $passwd));
21?>
22--EXPECT--
23bool(true)
24