@@ -76,7 +76,8 @@ public class SslExample {
76
76
public void httpTest () throws ArangoException {
77
77
78
78
ArangoConfigure configuration = new ArangoConfigure ();
79
- configuration .setArangoHost (new ArangoHost ("localhost" , 8529 ));
79
+ // get host and port from arangodb.properties
80
+ // configuration.setArangoHost(new ArangoHost("localhost", 8529));
80
81
configuration .init ();
81
82
82
83
ArangoDriver arangoDriver = new ArangoDriver (configuration );
@@ -110,9 +111,7 @@ public void sslWithSelfSignedCertificateTest() throws ArangoException, KeyManage
110
111
SSLContext sslContext = SSLContexts .custom ()
111
112
.loadTrustMaterial (Paths .get (resource .toURI ()).toFile (), SSL_TRUSTSTORE_PASSWORD .toCharArray ()).build ();
112
113
113
- ArangoConfigure configuration = new ArangoConfigure ();
114
- configuration .setArangoHost (new ArangoHost ("localhost" , 8530 ));
115
- configuration .setUseSsl (true );
114
+ ArangoConfigure configuration = new ArangoConfigure ("/ssl-arangodb.properties" );
116
115
configuration .setSslContext (sslContext );
117
116
configuration .init ();
118
117
@@ -124,9 +123,7 @@ public void sslWithSelfSignedCertificateTest() throws ArangoException, KeyManage
124
123
125
124
@ Test
126
125
public void sslHandshakeExceptionTest () {
127
- ArangoConfigure configuration = new ArangoConfigure ();
128
- configuration .setArangoHost (new ArangoHost ("localhost" , 8530 ));
129
- configuration .setUseSsl (true );
126
+ ArangoConfigure configuration = new ArangoConfigure ("/ssl-arangodb.properties" );
130
127
configuration .init ();
131
128
132
129
ArangoDriver arangoDriver = new ArangoDriver (configuration );
@@ -152,10 +149,9 @@ public void sslPeerUnverifiedExceptionTest() throws ArangoException, KeyManageme
152
149
SSLContext sslContext = SSLContexts .custom ()
153
150
.loadTrustMaterial (Paths .get (resource .toURI ()).toFile (), SSL_TRUSTSTORE_PASSWORD .toCharArray ()).build ();
154
151
155
- ArangoConfigure configuration = new ArangoConfigure ();
152
+ ArangoConfigure configuration = new ArangoConfigure ("/ssl-arangodb.properties" );
156
153
// 127.0.0.1 is the wrong name
157
- configuration .setArangoHost (new ArangoHost ("127.0.0.1" , 8530 ));
158
- configuration .setUseSsl (true );
154
+ configuration .getArangoHost ().setHost ("127.0.0.1" );
159
155
configuration .setSslContext (sslContext );
160
156
configuration .init ();
161
157
0 commit comments