Skip to content

Commit 0dd8a3d

Browse files
committed
fix ssl
1 parent 12ef2c8 commit 0dd8a3d

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

client/src/main/java/com/vesoft/nebula/client/storage/StorageClient.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import com.vesoft.nebula.storage.ScanEdgeRequest;
2626
import com.vesoft.nebula.storage.ScanVertexRequest;
2727
import com.vesoft.nebula.storage.VertexProp;
28+
2829
import java.io.Serializable;
2930
import java.io.UnsupportedEncodingException;
3031
import java.util.ArrayList;
@@ -34,6 +35,7 @@
3435
import java.util.List;
3536
import java.util.Map;
3637
import java.util.Set;
38+
3739
import org.slf4j.Logger;
3840
import org.slf4j.LoggerFactory;
3941

@@ -1205,10 +1207,17 @@ private void authUser() throws AuthFailedException, IOErrorException,
12051207
if (graphAddrAndPort.length != 2) {
12061208
throw new IllegalArgumentException("the graph address is invalid.");
12071209
}
1208-
graphConnection.open(new HostAddress(graphAddrAndPort[0].trim(),
1209-
Integer.valueOf(graphAddrAndPort[1].trim())), timeout, false,
1210-
new HashMap<>(),
1211-
version);
1210+
if (sslParam == null) {
1211+
graphConnection.open(new HostAddress(graphAddrAndPort[0].trim(),
1212+
Integer.valueOf(graphAddrAndPort[1].trim())), timeout, false,
1213+
new HashMap<>(),
1214+
version);
1215+
} else {
1216+
graphConnection.open(new HostAddress(graphAddrAndPort[0].trim(),
1217+
Integer.valueOf(graphAddrAndPort[1].trim())), timeout, sslParam, false,
1218+
new HashMap<>(),
1219+
version);
1220+
}
12121221
AuthResult authResult = graphConnection.authenticate(user, password);
12131222
long sessionId = authResult.getSessionId();
12141223

0 commit comments

Comments
 (0)