Skip to content

Commit bf31800

Browse files
committed
Use connection string in user certificate sample
1 parent f470dab commit bf31800

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

db-client-java/src/test/java/com/eventstore/dbclient/samples/authentication/UserCertificate.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@
22

33
import com.eventstore.dbclient.EventStoreDBClient;
44
import com.eventstore.dbclient.EventStoreDBClientSettings;
5+
import com.eventstore.dbclient.EventStoreDBConnectionString;
56

67
public class UserCertificate {
78
private static void tracing() {
89
// region client-with-user-certificates
9-
EventStoreDBClientSettings settings = EventStoreDBClientSettings.builder()
10-
.tls(true)
11-
.defaultClientCertificate("/path/to/ca.crt", "/path/to/ca.key")
12-
.defaultCredentials("admin", "changeit")
13-
.buildConnectionSettings();
14-
10+
EventStoreDBClientSettings settings = EventStoreDBConnectionString
11+
.parseOrThrow("esdb://admin:changeit@{endpoint}?tls=true&userCertFile={pathToCaFile}&userKeyFile={pathToKeyFile}");
1512
EventStoreDBClient client = EventStoreDBClient.create(settings);
1613
// endregion client-with-user-certificates
1714
}

0 commit comments

Comments
 (0)