Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> DBMS_LDAP error

DBMS_LDAP error

From: rjamya <rjamya_at_gmail.com>
Date: Wed, 30 Mar 2005 11:41:17 -0500
Message-ID: <9177895d0503300841700eb6f0@mail.gmail.com>


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_at_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 Received on Wed Mar 30 2005 - 11:45:01 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US