Does Microsoft ADSI provider support LDAP with SSL for querying Sun
Directory Server using ASP Code running on IIS 6.0?
I was successfull in querying LDAP for Sun One Directory Server with
Non-SSL. When Sun One Directory Server is Enabled with SSL I could perform
LDAP bind to the Sun One Directory through Softerra LDAP Browser but unable
to query the same using ASP code.
Softerra LDAP browser also couldn't able to perform query initially when
certificate database was not configured to it.
I configured Cert7.db and Key3.db to Softerra LDAP Browser as given
instruction from help documentation.
I tried importing SSL certificate and CA root certificate to Keystore /
Certificate store and running application query was not sucessfull.
Let me know How to configure Certificate Database file like Cert7.db and
Key3.db to our ASP application running on IIS 6.0?
I initially tried the same with MS Active Directory.
This is the Query I tried for Sun One Directory:
------------------------------------------------------------
Const ADS_SCOPE_SUBTREE = 2
'strQuery = "SELECT ADsPath FROM
'LDAP://192.168.28.26:30242/DC=myrcplus,DC=COM' WHERE objectClass='*' "
strQuery = "SELECT ADsPath FROM
'LDAPS://192.168.28.26:6123/DC=myrcplus,DC=COM' WHERE objectClass='*' " (
This statement not works when i query using LDAPS Port)
ADS_SECURE_AUTHENTICATION=1
'ADS_USE_SSL=2
set oConn = server.CreateObject("ADODB.Connection")
oConn.Provider = "ADsDSOObject"
oConn.Properties("User ID") = "uid=DJayaprakash,dc=myrcplus,dc=com"
oConn.Properties("Password") = "slk006@"
oConn.Properties("Encrypt Password") = True
oConn.Open "ADSI"
oConn.Properties("ADSI Flag") =1
set cmd = server.CreateObject("ADODB.Command")
cmd.ActiveConnection = oConn
cmd.CommandText = strQuery
cmd.Properties("Searchscope") = ADS_SCOPE_SUBTREE
on error resume next
set oRS = cmd.Execute
oRS.MoveFirst
count=oRs.RecordCount
response.Write "count=" &count
And this is code for MS Active Directory
-------------------------------------------------
dim strUser
' assume failure
AuthenticateUser = false
strQuery = "SELECT cn FROM 'LDAPS://192.168.28.26:636/dc=myrcplus,dc=com'
WHERE objectClass='*' "
set oConn = server.CreateObject("ADODB.Connection")
oConn.Provider = "ADsDSOOBJECT"
oConn.Properties("User ID") = strUser
oConn.Properties("Password") = strPassword
oConn.Properties("ADSI FLAG") = 1
oConn.Properties("Encrypt Password") = true
oConn.open "DS Query"
set cmd = server.CreateObject("ADODB.Command")
set cmd.ActiveConnection = oConn
cmd.CommandText = strQuery
on error resume next
set oRS = cmd.Execute
if oRS.bof or oRS.eof then
AuthenticateUser = false
Response.Write("Failed")
else
AuthenticateUser = true
Response.Write("Success")
Response.Write(oRS.Fields(0))
end if
set oRS = nothing
set oConn = nothing
Both the code works fine with Non-SSL port.
Waiting for your reply ASAP for Query changes or some configuration on IIS
to load Client Certificate Key from Application to Server.
Regards
Suresh