Skip to content
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
5 changes: 3 additions & 2 deletions src/main/java/net/spy/memcached/MemcachedConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;

import javax.security.sasl.Sasl;
import javax.security.sasl.SaslClient;

import net.spy.memcached.auth.AuthDescriptor;
Expand All @@ -65,6 +64,8 @@
import net.spy.memcached.ops.OperationStatus;
import net.spy.memcached.ops.OperationType;

import static net.spy.memcached.auth.ScramSaslClient.ScramSaslClientFactory;

/**
* Connection to a cluster of memcached servers.
*/
Expand Down Expand Up @@ -618,7 +619,7 @@ private void prepareAuthentication(final MemcachedNode node) {

final SaslClient sc;
try {
sc = Sasl.createSaslClient(authDescriptor.getMechs(), null,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@uhm0311

import javax.security.sasl.Sasl;

기존에 위와 같이 import하면, 장비 환경의 java security 설정에 따라 static Sasl 객체가 달라졌다는 것이죠?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기존 코드의 버그인 거네요.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sasl 객체의 createSaslClient() 메소드에서 반환해주는 값이 달라질 수 있습니다.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static Sasl 객체는 동일하고 java security 설정에 따라 createSaslClient() 메소드에서 반환해주는 객체가 달라지는 건가요?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그렇습니다.

sc = new ScramSaslClientFactory().createSaslClient(authDescriptor.getMechs(), null,
"memcached", node.getSocketAddress().toString(), null, authDescriptor.getCallback());
} catch (Exception e) {
throw new IllegalStateException("Can't create SaslClient", e);
Expand Down