DBMS_LDAP error
- From: rjamya <rjamya@xxxxxxxxx>
- To: Oracle Discussion List <oracle-l@xxxxxxxxxxxxx>
- Date: Wed, 30 Mar 2005 11:41:17 -0500
Hi all,
I am testing authentication to MS AD from oracle using dbms_ldap.
Using non-ssl method, it works great, but using SSL (which we prefer)
fails with following message.
Error code : -31202
Error Message : ORA-31202: DBMS_LDAP: LDAP client/server error: UnKnown Error
I am clueless as to the reason.
I however traced the LDAP (using exec
dbms_ldap.set_trace_level(65535);) and following message come up in
the trace files ...
Bridge Debug : TDP : SSL allocated memory is at 1 4096 bytes
Bridge Debug : sgslunrRead: Entry
Bridge Debug : sgslunrRead: Error while reading communication end point (2)
Does anyone have any clue what's going wrong? I am not using OID, just
plain simple test.
code is below if you are interested ...
oraclei@pallas-RELNCS2> less ldap2.sql
set serveroutput on size 30000
set verify off echo off
exec dbms_ldap.set_trace_level(65535);
DECLARE
retval PLS_INTEGER;
my_session DBMS_LDAP.session;
ldap_host VARCHAR2(256);
ldap_port VARCHAR2(256);
ldap_user VARCHAR2(256);
ldap_passwd VARCHAR2(256);
ldap_base VARCHAR2(256);
BEGIN
retval := -1;
-- Please customize the following variables as needed
--ldap_host := 'ldap.corp.espn.pvt' ;
ldap_host := 'xxxxx.corp.espn.pvt' ;
ldap_port := '636';
ldap_user := 'CN=Jamadagni\, Rajendra,OU=Users,OU=xxx,DC=xxx,DC=xxx,DC=xxx';
ldap_passwd:= '&&pwd';
ldap_base := 'cn=orcladmin,cn=users,dc=acme,dc=org';
-- end of customizable settings
DBMS_OUTPUT.PUT_line('DBMS_LDAP Search Example ');
DBMS_OUTPUT.PUT_LINE('to directory .. ');
DBMS_OUTPUT.PUT_LINE(RPAD('LDAP Host ',25,' ') || ': ' || ldap_host);
DBMS_OUTPUT.PUT_LINE(RPAD('LDAP Port ',25,' ') || ': ' || ldap_port);
-- Choosing exceptions to be raised by DBMS_LDAP library.
DBMS_LDAP.USE_EXCEPTION := TRUE;
my_session := DBMS_LDAP.init(ldap_host,ldap_port);
DBMS_OUTPUT.PUT_line('DBMS_LDAP init complete ');
retval := DBMS_LDAP.open_ssl(my_session, ldap_user, '&&pwd', 1);
DBMS_OUTPUT.PUT_LINE (RPAD('Ldap session 1 ',25,' ') || ': ' ||
RAWTOHEX(SUBSTR(my_session,1,8)) || '(returned from init)');
-- bind to the directory
retval := DBMS_LDAP.simple_bind_s(my_session, ldap_user, '&&pwd');
DBMS_OUTPUT.PUT_LINE(RPAD('simple_bind_s Returns ',25,' ') || ': ' ||
TO_CHAR(retval));
-- unbind from the directory
retval := DBMS_LDAP.unbind_s(my_session);
DBMS_OUTPUT.PUT_LINE(RPAD('unbind_res Returns ',25,' ') || ': ' ||
TO_CHAR(retval));
DBMS_OUTPUT.PUT_LINE('Directory operation Successful .. exiting');
-- Handle Exceptions
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(' Error code : ' || TO_CHAR(SQLCODE));
DBMS_OUTPUT.PUT_LINE(' Error Message : ' || SQLERRM);
DBMS_OUTPUT.PUT_LINE(' Exception encountered .. exiting');
END;
/
exec dbms_ldap.set_trace_level(0);
And of course it fails with following after init.
Error code : -31202
Error Message : ORA-31202: DBMS_LDAP: LDAP client/server error: UnKnown Error
TIA
Raj
------------------------------
select standard_disclaimer from company_requirements where category =
'MANDATORY';
--
http://www.freelists.org/webpage/oracle-l
- Follow-Ups:
- Re: DBMS_LDAP error
- From: rjamya
Other related posts:
- » DBMS_LDAP error
- » Re: DBMS_LDAP error
- » Re: DBMS_LDAP error
- » Re: DBMS_LDAP error
- Re: DBMS_LDAP error
- From: rjamya