Skip to content

examples/mslcli: point the client scripts at the server's /mslcli-server context path - #330

Open
yottt-1 wants to merge 1 commit into
Netflix:masterfrom
yottt-1:fix/mslcli-example-url-context-path
Open

yottt-1 wants to merge 1 commit into
Netflix:masterfrom
yottt-1:fix/mslcli-example-url-context-path

Conversation

@yottt-1

@yottt-1 yottt-1 commented Sep 18, 2026

Copy link
Copy Markdown

The mslcli example server registers its handler at /mslcli-server:

// examples/mslcli/server/src/main/java/mslcli/server/SimpleHttpServer.java:58
server.createContext("/mslcli-server", new MyHandler(mslServer));

and line 60 logs that same path on startup.

Five of the six scripts in examples/mslcli/client/src/dist/bin/ pass -url http://localhost:8080/msl instead, all on line 6:

  • mslclient_eas-none.sh:6
  • mslclient_eas-none_suffixed.sh:6
  • mslclient_interactive.sh:6
  • mslclient_single_send.sh:6
  • mslclient_with_mslstore.sh:6

(The sixth, mslclient.sh, takes -url from its arguments and hardcodes nothing.)

Nothing is registered at /msl, so these scripts fail against the server they are meant to drive. This PR changes the path to /mslcli-server in all five. The port is already correct — app.server.port 8080 in examples/mslcli/server/src/dist/bin/mslsrv.cfg:14 — so only the path changes.

Verification

Run on a machine where port 8080 was already in use, so the server's app.server.port was set to 18080 for the test; only the port differs from the shipped configuration.

Server started as mslserver.sh invokes it (mslcli.server.SimpleHttpServer -cfg mslsrv.cfg -eid server1 -eas RSA):

waiting for requests on http://localhost:18080/mslcli-server ...

The path the scripts use is not registered:

$ curl -s -i -X POST --data 'test' http://localhost:18080/msl
HTTP/1.1 404 Not Found
Content-Length: 50
Content-Type: text/html
Connection: close

<h1>404 Not Found</h1>No context found for request

while the registered path answers:

$ curl -s -o /dev/null -w "HTTP %{http_code}, %{size_download} bytes\n" \
    -X POST --data 'test' http://localhost:18080/mslcli-server
HTTP 200, 642 bytes

Using mslclient_single_send.sh's exact argument list (-kx DIFFIE_HELLMAN -eid client1 -uid user1 -if request.dat -eas PSK -uas EMAIL_PASSWORD), unchanged except for the URL:

with /msl —

Error: http://localhost:18080/msl
java.io.FileNotFoundException: http://localhost:18080/msl
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:2030)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1632)
	at com.netflix.msl.io.JavaUrl$DelayedInputStream.openOnce(JavaUrl.java:71)
	at com.netflix.msl.io.JavaUrl$DelayedInputStream.read(JavaUrl.java:111)
	at com.netflix.msl.io.MslEncoderFactory.createTokenizer(MslEncoderFactory.java:162)

with /mslcli-server —

Response: hello from mslcli

Messages Sent: 1, Total Time: 505 msec, Per Message: 505 msec
Exit Status 0: Success

mslclient_eas-none.sh's argument list (-eid client3 -eas NONE -kx ASYMMETRIC_WRAPPED -kxm JWE_RSA) behaves the same way against /mslcli-server: Response: hello from mslcli, Exit Status 0: Success. The remaining three scripts differ from these two only in entity id, key exchange and MSL store arguments, none of which affect the URL, so they were not run individually.

The two scripts that pass -if request.dat need that file to exist in the working directory; that is pre-existing behaviour and unrelated to this change.

Nothing else in the repository hardcodes this path. mslclient_manual.txt documents -url <server-url> generically, and integ-tests/src/main/README.md:9 refers to http://localhost:8080/msl-integ-tests/, which is a different application and is left alone.

SimpleHttpServer registers its handler at /mslcli-server, but the five
example client scripts pass -url http://localhost:8080/msl, so they fail
against the server they are meant to drive. Update the URLs to match.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant