Skip to content

Commit

Permalink
ignore auth required flag from server (#807)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottf authored Nov 25, 2022
1 parent 364f9d0 commit 766759a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/io/nats/client/impl/NatsConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,9 @@ public void flush(Duration timeout) throws TimeoutException, InterruptedExceptio
void sendConnect(String serverURI) throws IOException {
try {
ServerInfo info = this.serverInfo.get();
CharBuffer connectOptions = this.options.buildProtocolConnectOptionsString(serverURI, info.isAuthRequired(), info.getNonce());
// This is changed - we used to use info.isAuthRequired(), but are changing it to
// better match older versions of the server. It may change again in the future.
CharBuffer connectOptions = this.options.buildProtocolConnectOptionsString(serverURI, true, info.getNonce());
ByteArrayBuilder bab =
new ByteArrayBuilder(OP_CONNECT_SP_LEN + connectOptions.limit(), UTF_8)
.append(CONNECT_SP_BYTES).append(connectOptions);
Expand Down

0 comments on commit 766759a

Please sign in to comment.