We're trying to get Play setup to talk to our internal CRM. All of our prior apps have been written in an overkill JSF framework (ICEfaces) - but they worked fine in talking to our CRM since the JSF apps were deployed on a glassfish box where we had the certificates installed for glassfish to be able to communicate with our CRM web service.
Now we are trying to get play to do the same thing and we're having a bit of difficulty since we want to run the play apps on netty. How do we get certificates imported into a keystore (or similar) so that they can communicate with our CRM? Since the CRM is internal to our corporation, the certificates are self signed and distributed as needed.
I've tried the following in the play config file - but I'm not sure on this one since these config properties seem to be more for the play server itself rather than for the play app to communicate to another service.
# Keystore
trustmanager.algorithm=jks
ssl.KeyManagerFactory.algorithm=SunX509
keystore.algorithm=jks
keystore.password=changeit
keystore.file=conf/cacerts.jks
One of our other developers was able to get this to work, but we had to put it directly in our code which is not ideal.
System.setProperty("javax.net.ssl.trustStore", "C:/webapps/playapp1/cacerts.jks");
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
System.setProperty("javax.net.ssl.keyStoreType", "jks");
System.setProperty("javax.net.ssl.keyStore", "C:/webapps/playapp1/keystore.jks");
System.setProperty("javax.net.ssl.keyStorePassword", "changeit");
As a note, our CRM builds a jar file that we drop into our JSF or play apps that wraps the webservice for us so we don't have to build out client code for each service (similar to a jar you would download for say, Amazon's S3 service). That service jar uses Jersey underneath to communicate via XML / Rest back to our service. It works just fine in the play framework when we're not using SSL.