|
1 | 1 | Java Keystore LDAPS Test
|
2 | 2 | ====================
|
3 | 3 |
|
4 |
| -Adjust the configuration in Test.properties first. |
| 4 | +##Configuration |
| 5 | +See [`Test.properties`](https://github.com/mmoayyed/java-ldap-ssl-test/blob/master/Test.properties). |
5 | 6 |
|
| 7 | +##Build |
6 | 8 | To compile and then use, execute:
|
7 | 9 |
|
8 | 10 | ```
|
9 | 11 | javac Test.java
|
10 | 12 | java Test
|
11 | 13 | ```
|
12 |
| - |
| 14 | + |
| 15 | +##Sample output |
| 16 | +The log below demonstrates a sample of the program output configured to hit 5 ldap urls. |
| 17 | + |
| 18 | +``` |
| 19 | +[INFO] ******* Ldap Configuration ******* |
| 20 | +[INFO] com.sun.jndi.ldap.connect.timeout: 3000 |
| 21 | +[INFO] java.naming.factory.initial: com.sun.jndi.ldap.LdapCtxFactory |
| 22 | +[INFO] java.naming.security.principal: [email protected] |
| 23 | +[INFO] java.naming.provider.url: ldap://10.1.54.56 |
| 24 | +[INFO] java.naming.security.authentication: simple |
| 25 | +[INFO] java.naming.security.credentials: helloWorld! |
| 26 | +[INFO] ********************************** |
| 27 | +
|
| 28 | +[INFO] Failed to connect to ldap instance [ldap://10.1.54.56]. Trying next... |
| 29 | +
|
| 30 | +[INFO] ******* Ldap Configuration ******* |
| 31 | +[INFO] com.sun.jndi.ldap.connect.timeout: 3000 |
| 32 | +[INFO] java.naming.factory.initial: com.sun.jndi.ldap.LdapCtxFactory |
| 33 | +[INFO] java.naming.security.principal: [email protected] |
| 34 | +[INFO] java.naming.provider.url: ldap://10.1.1.3 |
| 35 | +[INFO] java.naming.security.authentication: simple |
| 36 | +[INFO] java.naming.security.credentials: helloWorld! |
| 37 | +[INFO] ********************************** |
| 38 | +
|
| 39 | +[INFO] Failed to connext to ldap instance [ldap://10.1.1.3]. Trying next... |
| 40 | +
|
| 41 | +[INFO] ******* Ldap Configuration ******* |
| 42 | +[INFO] com.sun.jndi.ldap.connect.timeout: 3000 |
| 43 | +[INFO] java.naming.factory.initial: com.sun.jndi.ldap.LdapCtxFactory |
| 44 | +[INFO] java.naming.security.principal: [email protected] |
| 45 | +[INFO] java.naming.provider.url: ldap://10.1.1.12 |
| 46 | +[INFO] java.naming.security.authentication: simple |
| 47 | +[INFO] java.naming.security.credentials: helloWorld! |
| 48 | +[INFO] ********************************** |
| 49 | +
|
| 50 | +[INFO] Failed to connext to ldap instance [ldap://10.1.1.12]. Trying next... |
| 51 | +
|
| 52 | +[INFO] ******* Ldap Configuration ******* |
| 53 | +[INFO] com.sun.jndi.ldap.connect.timeout: 3000 |
| 54 | +[INFO] java.naming.factory.initial: com.sun.jndi.ldap.LdapCtxFactory |
| 55 | +[INFO] java.naming.security.principal: [email protected] |
| 56 | +[INFO] java.naming.provider.url: ldap://10.1.1.1 |
| 57 | +[INFO] java.naming.security.authentication: simple |
| 58 | +[INFO] java.naming.security.credentials: helloWorld! |
| 59 | +[INFO] ********************************** |
| 60 | +
|
| 61 | +[INFO] Failed to connext to ldap instance [ldap://10.1.1.1]. Trying next... |
| 62 | +
|
| 63 | +[INFO] ******* Ldap Configuration ******* |
| 64 | +[INFO] com.sun.jndi.ldap.connect.timeout: 3000 |
| 65 | +[INFO] java.naming.factory.initial: com.sun.jndi.ldap.LdapCtxFactory |
| 66 | +[INFO] java.naming.security.principal: [email protected] |
| 67 | +[INFO] java.naming.provider.url: ldap://10.1.12.33 |
| 68 | +[INFO] java.naming.security.authentication: simple |
| 69 | +[INFO] java.naming.security.credentials: helloWorld! |
| 70 | +[INFO] ********************************** |
| 71 | +
|
| 72 | +[INFO] Successfully connected to the ldap url [ldap://10.1.12.33] |
| 73 | +
|
| 74 | +[INFO] ******* Ldap Search ******* |
| 75 | +[INFO] Ldap filter: (&(objectClass=*) (sAMAccountName=casadmin)) |
| 76 | +[INFO] Ldap search base: DC=somewhere,DC=local |
| 77 | +[INFO] Returning attributes: [cn, givenName] |
| 78 | +[INFO] *************************** |
| 79 | +
|
| 80 | +[INFO] ******* Ldap Search Results ******* |
| 81 | +[INFO] User name: CN=CAS Admin,OU=Other,OU=Users2 |
| 82 | +[INFO] User full name: CN=CAS Admin,OU=Other,OU=Users2,DC=somewhere,DC=local |
| 83 | +[INFO] givenName => givenName: CAS |
| 84 | +[INFO] cn => cn: CAS Admin |
| 85 | +[INFO] ************************************ |
| 86 | +
|
| 87 | +[INFO] Ldap search completed successfully. |
| 88 | +``` |
| 89 | + |
0 commit comments