marklogicml-gradle

ml-gradle specify HTTPS for port 8003


mlgradle version : 5.0.0

gradle mlDeploy got the following error:

* What went wrong:
Execution failed for task ':mlDeployApp'.
> Error occurred while calling http://<some-DNS-address>:8003/v1/config/properties; java.net.SocketException: Connection reset ; possible reasons for the error include that a MarkLogic app server may not be listening on the port, or MarkLogic was stopped or restarted during the request; check the MarkLogic server logs for more information.

Our firewall only allows HTTPS and I think that's why the connection failed. In the gradle.properties, I have the following to specify HTTPS, but it still uses HTTP for port 8003

mlManageSimpleSsl=true
mlAdminSimpleSsl=true
mlRestSimpleSsl=true
mlAppServicesSimpleSsl=true

How do I specify HTTPS for port 8003?


Solution

  • In order to enable TLS/SSL for communication with the application server, set mlSimpleSsl

    https://github.com/marklogic/ml-gradle/issues/304#issuecomment-362588977

    With 3.4.0, use mlSimpleSsl instead of mlRestSimpleSsl (I wish it were named the latter, but the former was created a long time ago, before the other "SimpleSsl" properties were created).

    https://github.com/marklogic/ml-gradle/wiki/Property-reference#rest-api-server-connection-properties

    Property Description
    mlSimpleSsl When modules are loaded via the Client REST API, if the app server requires an SSL connection, then setting this property to "true" will force a simple SSL connection to be created (a simple SSL context and 'ANY' hostname verifier). Starting 3.16.0, you can also set this to any value besides "true" or "false" to specify a particular protocol; TLSv1.2 is the default with 3.16.0. No default value.

    See the example SSL project: https://github.com/marklogic/ml-gradle/blob/master/examples/ssl-project/gradle.properties