Ldap / Laravel - 使用SSL或TLS时连接失败“使用未定义的常量LDAP_OPT_X_TLS_CACERTFILE”

时间:2018-05-03 10:03:49

标签: laravel openldap adldap

  • Laravel版本:5.2.45
  • Adldap2-Laravel版本:(截至今日)
  • PHP版本:7.2
  • LDAP类型:OpenLDAP

adldap.php:

            'use_ssl' => true,
            'use_tls' => false,

            'custom_options' => [
                LDAP_OPT_PROTOCOL_VERSION => 3,
                LDAP_OPT_X_TLS_CACERTFILE => "/etc/ssl/certs/ca_certs.pem"
            ],

使用未定义的常量LDAP_OPT_X_TLS_CACERTFILE - 在第230行的/var/www/laravel/config/adldap.php中假设为“LDAP_OPT_X_TLS_CACERTFILE”

日志:

1 - in Ldap.php line 176
2 - at HandleExceptions->handleError('2', 'ldap_set_option() expects parameter 2 to be long, string given', '/var/www/laravel/vendor/adldap2/adldap2/src/Connections/Ldap.php', '176', array('option' => 'LDAP_OPT_X_TLS_CACERTFILE', 'value' => '/etc/ssl/certs/ca_certs.pem'))
3 - at ldap_set_option(null, 'LDAP_OPT_X_TLS_CACERTFILE', '/etc/ssl/certs/ca_certs.pem') in Ldap.php line 176
4 - at Ldap->setOption('LDAP_OPT_X_TLS_CACERTFILE', '/etc/ssl/certs/ca_certs.pem') in Ldap.php line 185
5 - at Ldap->setOptions(array('3', 'LDAP_OPT_X_TLS_CACERTFILE' => '/etc/ssl/certs/ca_certs.pem', '5', false)) in Provider.php line 272
...

我正在尝试使用端口636连接到我的LDAP服务器,但它无法识别LDAP_OPT_X_TLS_CACERTFILE。想法?

0 个答案:

没有答案