Skip to content

Commit 827f534

Browse files
Merge branch 'master' of github.com:mmoayyed/java-ldap-ssl-test
Conflicts: Test.properties
2 parents 5b3f6cc + 5997a98 commit 827f534

File tree

2 files changed

+81
-3
lines changed

2 files changed

+81
-3
lines changed

README.md

+79-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,89 @@
11
Java Keystore LDAPS Test
22
====================
33

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).
56

7+
##Build
68
To compile and then use, execute:
79

810
```
911
javac Test.java
1012
java Test
1113
```
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+

Test.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
ldap.url1 = ldaps://1.2.3.4
12
ldap.url2 =
23
ldap.url3 =
34
ldap.url4 =
@@ -16,4 +17,4 @@ ldap.factory = com.sun.jndi.ldap.LdapCtxFactory
1617
ldap.authentication = simple
1718
ldap.timeout = 3000
1819

19-
ldap.authn.password = Dobby1757!
20+
ldap.authn.password = password!

0 commit comments

Comments
 (0)