Skip to content

MLE-17505 Updated test for MarkLogic 12 #1785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
import com.marklogic.client.test.junit5.RequiresML12;
import com.marklogic.mgmt.ManageClient;
import com.marklogic.mgmt.resource.appservers.ServerManager;
import org.junit.jupiter.api.*;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnJre;
import org.junit.jupiter.api.condition.JRE;
import org.junit.jupiter.api.extension.ExtendWith;
Expand Down Expand Up @@ -119,7 +122,9 @@ void noSslContext() {

DatabaseClient.ConnectionResult result = client.checkConnection();
assertEquals("Forbidden", result.getErrorMessage(), "MarkLogic is expected to return a 403 Forbidden when the " +
"user tries to access an HTTPS app server using HTTP");
"user tries to access an HTTPS app server using HTTP. This behavior changes in MarkLogic 12, and it may " +
"be considered a bit surprising with MarkLogic 11 and earlier - that is, the user probably shouldn't get " +
"any response back since a connection cannot be made without using SSL.");
assertEquals(403, result.getStatusCode());

ForbiddenUserException ex = assertThrows(ForbiddenUserException.class,
Expand All @@ -133,6 +138,17 @@ void noSslContext() {
);
}

@ExtendWith(RequiresML12.class)
@Test
void noSslContextWithMarkLogic12() {
DatabaseClient client = Common.newClientBuilder().build();

MarkLogicIOException ex = assertThrows(MarkLogicIOException.class, () -> client.checkConnection());
assertTrue(ex.getMessage().contains("unexpected end of stream"), "Per MLE-17505, a change in the openssl " +
"library used by the server results in an IO exception when the client tries to connect to an " +
"app server that requires SSL, but the client does not use SSL. Actual message: " + ex.getMessage());
}

@Test
void tLS13ClientWithTLS12Server() {
DatabaseClient client = buildTrustAllClientWithSSLProtocol(SSLUtil.DEFAULT_PROTOCOL);
Expand Down