1) Vytvořte oracle wallet pomocí Oracle Wallet manager ( owm )2) Naimportujte certifikát z certifikační autority3) A zde přikládám část příkladu s použitím balíku DBMS_LDAP– Změnte si proměnné dle vašeho aktuálního nastaveníldap_host := ‘‘ ;ldap_port := ‘‘;ldap_user := ‘uid=,ou=,dc=,dc=com‘;ldap_passwd:= ‘12345′;
– konec volitelných proměnnýchDBMS_OUTPUT.PUT(’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 (RPAD(’Ldap session ‘,25,’ ‘) || ‘: ‘ ||RAWTOHEX(SUBSTR(my_session,1,8)) ||‘(returned from init)’);– Establish SSL connection to the directoryretval := DBMS_LDAP.open_ssl(my_session,‘file:‘,‘‘,2); — NO_AUTH : 1– ONE_WAY_AUTH: 2– TWO_WAY_AUTH: 3DBMS_OUTPUT.PUT_LINE(RPAD(’open_ssl Returns ‘,25,’ ‘) || ‘: ‘|| TO_CHAR(retval));– bind to the directoryretval := DBMS_LDAP.simple_bind_s(my_session,ldap_user, ldap_passwd);OUTPUT======SQL> @sslbind.sqlDBMS_LDAP Search Example to directory ..LDAP Host : myldap.server.czLDAP Port : 636Ldap session : 01000000(returned from init)open_ssl Returns : 0simple_bind_s Returns : 0unbind_res Returns : 0Directory operation Successful .. exitingPL/SQL procedure successfully completed.You can get following error:Error Message : ORA-31202: DBMS_LDAP: LDAP client/server error: UnKnown ErrorSolution:Check path, password and wallet namepath should ended by directory where is wallet savedwallet name must be ewallet.p12
Komentáře