score:1

Accepted answer

ok, so, the bug was that the sun ldap library can not load the jks file from the jar. the workaround was to extract the file from the car to tomcat temp dir, then setting this "real" file as javax.net.ssl.truststore property.

        string tmpdir = system.getenv("catalina_tmpdir");
        if(tmpdir == null)
            tmpdir = system.getenv("catalina_home") + "/temp";
        final string tmpjksfile = tmpdir + "/ldap.jks";
        url ts = getclass().getresource("/ldap.jks");
        try {
            inputstream in = new bufferedinputstream(ts.openstream());
            outputstream out = new bufferedoutputstream(new fileoutputstream(tmpjksfile));
            ioutils.copy(in, out);
            out.flush();
            out.close();
            in.close();
        } catch (ioexception eio) {
            /* your logging */
        }


        system.setproperty(truststoreproperty, tmpjksfile);

Related Query

More Query from same tag