Skip to content

Commit 7601482

Browse files
rjrudinanu3990
authored andcommitted
Added an app server that requires SSL
Should make it easier to write tests that test SSL with the Node Client.
1 parent 1d425aa commit 7601482

File tree

4 files changed

+45
-1
lines changed

4 files changed

+45
-1
lines changed

test-app/build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,15 @@ tasks.register("addMarkLogic12SchemasIfNecessary", com.marklogic.gradle.task.Mar
1515
}
1616
mlDeploy.dependsOn addMarkLogic12SchemasIfNecessary
1717
mlLoadSchemas.dependsOn addMarkLogic12SchemasIfNecessary
18+
19+
/*
20+
* Required for forcing MarkLogic to generate a temporary certificate for the app server
21+
* that requires SSL.
22+
*/
23+
ext {
24+
def command = new com.marklogic.appdeployer.command.security.GenerateTemporaryCertificateCommand()
25+
command.setTemplateIdOrName("node-client-ssl-template")
26+
command.setCommonName("localhost")
27+
command.setValidFor(365)
28+
mlAppDeployer.commands.add(command)
29+
}

test-app/docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ services:
1515
- ./docker/marklogic/logs:/var/opt/MarkLogic/Logs
1616
ports:
1717
- 8000-8002:8000-8002
18-
- 8015:8015
18+
- 8015-8016:8015-8016
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<certificate-template-properties xmlns="http://marklogic.com/manage">
2+
<template-name>node-client-ssl-template</template-name>
3+
<template-description>This template is for testing SSL with the Node Client.</template-description>
4+
<key-type>rsa</key-type>
5+
<key-options />
6+
<req>
7+
<version>0</version>
8+
<subject>
9+
<countryName>US</countryName>
10+
<stateOrProvinceName>VA</stateOrProvinceName>
11+
<localityName>McLean</localityName>
12+
<organizationName>MarkLogic</organizationName>
13+
<organizationalUnitName>Sales</organizationalUnitName>
14+
<emailAddress>nobody@marklogic.com</emailAddress>
15+
</subject>
16+
</req>
17+
</certificate-template-properties>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"server-name": "unittest-nodeapi-ssl",
3+
"server-type": "http",
4+
"root": "/",
5+
"group-name": "Default",
6+
"port": 8016,
7+
"modules-database": "%%MODULES_DATABASE%%",
8+
"content-database": "%%DATABASE%%",
9+
"ssl-certificate-template": "node-client-ssl-template",
10+
"url-rewriter": "/MarkLogic/rest-api/rewriter.xml",
11+
"rewrite-resolves-globally": true,
12+
"error-handler": "/MarkLogic/rest-api/error-handler.xqy",
13+
"default-error-format": "json"
14+
}
15+

0 commit comments

Comments
 (0)