|
37 | 37 | import com.arangodb.ArangoHost;
|
38 | 38 | import com.arangodb.entity.ArangoVersion;
|
39 | 39 | import com.arangodb.http.HttpResponseEntity;
|
| 40 | +import com.arangodb.util.TestUtils; |
40 | 41 |
|
41 | 42 | /*-
|
42 | 43 | * Example for using a HTTPS connection
|
@@ -95,21 +96,24 @@ public void httpTest() throws ArangoException {
|
95 | 96 |
|
96 | 97 | @Test
|
97 | 98 | public void sslConnectionTest() throws ArangoException {
|
98 |
| - // use HTTPS with java default trust store |
99 |
| - ArangoConfigure configuration = null; |
100 |
| - try { |
101 |
| - configuration = new ArangoConfigure(); |
102 |
| - configuration.setArangoHost(new ArangoHost("www.arangodb.com", 443)); |
103 |
| - configuration.setUseSsl(true); |
104 |
| - configuration.init(); |
105 |
| - |
106 |
| - final ArangoDriver arangoDriver = new ArangoDriver(configuration); |
107 |
| - |
108 |
| - final HttpResponseEntity response = arangoDriver.getHttpManager().doGet("/"); |
109 |
| - Assert.assertEquals(200, response.getStatusCode()); |
110 |
| - } finally { |
111 |
| - if (configuration != null) { |
112 |
| - configuration.shutdown(); |
| 99 | + final String javaVersion = System.getProperty("java.version"); |
| 100 | + if (TestUtils.compareVersion(javaVersion, "1.7") > -1) { |
| 101 | + // use HTTPS with java default trust store |
| 102 | + ArangoConfigure configuration = null; |
| 103 | + try { |
| 104 | + configuration = new ArangoConfigure(); |
| 105 | + configuration.setArangoHost(new ArangoHost("www.arangodb.com", 443)); |
| 106 | + configuration.setUseSsl(true); |
| 107 | + configuration.init(); |
| 108 | + |
| 109 | + final ArangoDriver arangoDriver = new ArangoDriver(configuration); |
| 110 | + |
| 111 | + final HttpResponseEntity response = arangoDriver.getHttpManager().doGet("/"); |
| 112 | + Assert.assertEquals(200, response.getStatusCode()); |
| 113 | + } finally { |
| 114 | + if (configuration != null) { |
| 115 | + configuration.shutdown(); |
| 116 | + } |
113 | 117 | }
|
114 | 118 | }
|
115 | 119 | }
|
|
0 commit comments