Domino JNDI LDAPs

I have an agent that uses Java (JNDI) to connect to an LDAP server and retrieve attributes for the logged in user. This agent works fine when using standard LDAP, but when I try to connect over LDAPs, I’m getting handshake errors.

I know that I need to do something with Java keystores, but I don’t know exactly what. Can someone tell me what I need to do to establish that trust, and how to go about doing so? Do I need to use keytool or iKeyman? Into which file do I need to import certificates? etc…

Thanks in advance for any help.