Skip to content

Commit

Permalink
fix ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicole00 committed Jan 2, 2024
1 parent 12ef2c8 commit 0dd8a3d
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.vesoft.nebula.storage.ScanEdgeRequest;
import com.vesoft.nebula.storage.ScanVertexRequest;
import com.vesoft.nebula.storage.VertexProp;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
Expand All @@ -34,6 +35,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -1205,10 +1207,17 @@ private void authUser() throws AuthFailedException, IOErrorException,
if (graphAddrAndPort.length != 2) {
throw new IllegalArgumentException("the graph address is invalid.");
}
graphConnection.open(new HostAddress(graphAddrAndPort[0].trim(),
Integer.valueOf(graphAddrAndPort[1].trim())), timeout, false,
new HashMap<>(),
version);
if (sslParam == null) {
graphConnection.open(new HostAddress(graphAddrAndPort[0].trim(),
Integer.valueOf(graphAddrAndPort[1].trim())), timeout, false,
new HashMap<>(),
version);
} else {
graphConnection.open(new HostAddress(graphAddrAndPort[0].trim(),
Integer.valueOf(graphAddrAndPort[1].trim())), timeout, sslParam, false,
new HashMap<>(),
version);
}
AuthResult authResult = graphConnection.authenticate(user, password);
long sessionId = authResult.getSessionId();

Expand Down

0 comments on commit 0dd8a3d

Please sign in to comment.