Open rbeckman-nextgen opened 4 years ago
FWIW, this system property can be set in mcserver.vmoptions.
By the time your Javascript runs, this property has already probably been read by the underlying code and later changes will be ignored.
Imported Comment. Original Details: Author: cschultz@chadis.com Created: 2018-12-12T17:28:11.000-0800
My company has been successfully using the HttpsURLConnection class in an external Java package which we've been referencing though a JavaScript Writer. We use the class to do secure POSTs and GETs.
We now have a case where we need to introduce a trusted certificate and a keystore to create a secure SSLSocketFactory. We add the trusted certificate to the CACERTS file of the server and reference the keystore file within the class as follows:
SSLSocketFactory sslSocketFactory = getFactory(new File(CERTIFICATE_PATH), CERTIFICATE_PASSWORD);
The SSLSocketFactory simply adds the keystore to the KeyManagerFactory and returns the appropriate SSLContext in the SSLSocketFactory.
Now for the problem: When executing the methods on the class that do a GET or POST outside of the Mirth environment, it works without error. When we package up the JAR and include it as a custom library within the Mirth environment, we receive a Socket timeout as a result of a call to the following method: