Skip to content

Commit 3e1cbf6

Browse files
authored
Merge pull request #211 from splunk/Release/1.9.4
Release/1.9.4
2 parents 00cd195 + 396bec3 commit 3e1cbf6

File tree

9 files changed

+59
-25
lines changed

9 files changed

+59
-25
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Splunk Enterprise SDK for Java Changelog
22

3+
## Version 1.9.4
4+
5+
### Minor Changes
6+
* Added check for localhost IPv6 address, for IPv6 compatible apps (GitHub PR [#210](https://github.com/splunk/splunk-sdk-java/pull/210))
7+
* Updating SSL_SOCKET_FACTORY instance on changing _validateCertificates_ flag. (GitHub PR [#206](https://github.com/splunk/splunk-sdk-java/pull/210))
8+
39
## Version 1.9.3
410

511
### Minor Changes

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[![Java SDK Test](https://github.com/splunk/splunk-sdk-java/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/splunk/splunk-sdk-java/actions/workflows/test.yml)
22
# The Splunk Software Development Kit for Java
33

4-
#### Version 1.9.3
4+
#### Version 1.9.4
55

66
The Splunk Software Development Kit (SDK) for Java contains library code and
77
examples designed to enable developers to build applications using Splunk.
@@ -75,7 +75,7 @@ To add the Splunk SDK for Java `.JAR` file as a dependency:
7575
<dependency>
7676
<groupId>com.splunk</groupId>
7777
<artifactId>splunk</artifactId>
78-
<version>1.9.3</version>
78+
<version>1.9.4</version>
7979
</dependency>
8080
</dependencies>
8181
```

deploy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare -r scriptDirectory="$(dirname $(readlink -e $0))"
44
declare -r scriptName="$(basename $0)"
5-
declare -r version="1.9.3"
5+
declare -r version="1.9.4"
66

77
if [[ $# -ne 1 ]]; then
88
echo 1>&2 "Usage: ${scriptName} {local|staging||production}"

deploy.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ deploy \<repository-name>
99

1010
##DESCRIPTION
1111

12-
Deploy transmits **target/splunk-1.9.3.jar**, **target/splunk-1.9.3-javadoc.jar**, and
13-
**target/splunk-1.9.3-sources.jar** to the **local**, **staging**, or **production**
12+
Deploy transmits **target/splunk-1.9.4.jar**, **target/splunk-1.9.4-javadoc.jar**, and
13+
**target/splunk-1.9.4-sources.jar** to the **local**, **staging**, or **production**
1414
maven repository. Repository names are mapped to locations as follows.
1515

1616
| repository-name | location |
@@ -21,18 +21,18 @@ maven repository. Repository names are mapped to locations as follows.
2121

2222
After deployment you should find this tree structure at the location of your repository
2323

24-
com/splunk/splunk/1.9.3/
25-
├── splunk-1.9.3-javadoc.jar
26-
├── splunk-1.9.3-javadoc.jar.md5
27-
├── splunk-1.9.3-javadoc.jar.sha1
28-
├── splunk-1.9.3-sources.jar
29-
├── splunk-1.9.3-sources.jar.md5
30-
├── splunk-1.9.3-sources.jar.sha1
31-
├── splunk-1.9.3.jar
32-
├── splunk-1.9.3.jar.md5
33-
├── splunk-1.9.3.jar.sha1
34-
├── splunk-1.9.3.pom
35-
├── splunk-1.9.3.pom.md5
36-
└── splunk-1.9.3.pom.sha1
24+
com/splunk/splunk/1.9.4/
25+
├── splunk-1.9.4-javadoc.jar
26+
├── splunk-1.9.4-javadoc.jar.md5
27+
├── splunk-1.9.4-javadoc.jar.sha1
28+
├── splunk-1.9.4-sources.jar
29+
├── splunk-1.9.4-sources.jar.md5
30+
├── splunk-1.9.4-sources.jar.sha1
31+
├── splunk-1.9.4.jar
32+
├── splunk-1.9.4.jar.md5
33+
├── splunk-1.9.4.jar.sha1
34+
├── splunk-1.9.4.pom
35+
├── splunk-1.9.4.pom.md5
36+
└── splunk-1.9.4.pom.sha1
3737

3838
Verify this structure prior to release.

examples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<dependency>
3838
<groupId>com.splunk</groupId>
3939
<artifactId>splunk</artifactId>
40-
<version>1.9.3</version>
40+
<version>1.9.4</version>
4141
<scope>provided</scope>
4242
</dependency>
4343
<dependency>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<modelVersion>4.0.0</modelVersion>
77

88
<properties>
9-
<version.number>1.9.3</version.number>
9+
<version.number>1.9.4</version.number>
1010
<maven.resources.overwrite>true</maven.resources.overwrite>
1111
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1212
<maven.compiler.source>8</maven.compiler.source>

splunk/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66

77
<artifactId>splunk</artifactId>
8-
<version>1.9.3</version>
8+
<version>1.9.4</version>
99
<parent>
1010
<artifactId>splunk-sdk-java</artifactId>
1111
<groupId>com.splunk</groupId>

splunk/src/main/java/com/splunk/HttpService.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,11 @@ public class HttpService {
5252
private static String HTTP_SCHEME = "http";
5353
private static String HOSTNAME = "localhost";
5454
private static String HOSTIP = "127.0.0.1";
55+
private static String HOSTIPv6 = "::1";
5556

5657
private static final HostnameVerifier HOSTNAME_VERIFIER = new HostnameVerifier() {
5758
public boolean verify(String s, SSLSession sslSession) {
58-
if (s.equals(HOSTNAME) || s.equals(HOSTIP)) {
59+
if (s.equals(HOSTNAME) || s.equals(HOSTIP) || s.equals(HOSTIPv6)) {
5960
return true;
6061
} else {
6162
HostnameVerifier hv = HttpsURLConnection.getDefaultHostnameVerifier();
@@ -90,7 +91,7 @@ public boolean verify(String s, SSLSession sslSession) {
9091
private String prefix = null;
9192

9293
static Map<String, String> defaultHeader = new HashMap<String, String>() {{
93-
put("User-Agent", "splunk-sdk-java/1.9.3");
94+
put("User-Agent", "splunk-sdk-java/1.9.4");
9495
put("Accept", "*/*");
9596
}};
9697

@@ -558,8 +559,12 @@ public static SSLSocketFactory getSSLSocketFactory() {
558559
return HttpService.sslSocketFactory;
559560
}
560561

561-
public static void setValidateCertificates(boolean validateCertificates) {
562-
HttpService.validateCertificates = validateCertificates;
562+
public static void setValidateCertificates(boolean validateCertificate) {
563+
// update the SSL_SOCKET_FACTORY if validateCertificates flag is changed
564+
if (validateCertificates != validateCertificate) {
565+
validateCertificates = validateCertificate;
566+
sslSocketFactory = createSSLFactory();
567+
}
563568
}
564569

565570
public static SSLSocketFactory createSSLFactory() {

splunk/src/test/java/com/splunk/HttpServiceTest.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,29 @@ public void setUp() throws Exception {
4141
);
4242
}
4343

44+
@Test
45+
public void testHttpServiceWithHostIP(){
46+
HttpService service = new HttpService("127.0.0.1");
47+
ResponseMessage response = service.get("/");
48+
Assert.assertEquals(200, response.getStatus());
49+
Assert.assertTrue(firstLineIsXmlDtd(response.getContent()));
50+
}
51+
52+
@Test
53+
public void testHttpServiceWithHostIPv6(){
54+
// IPv6 Host without the [] brackets
55+
HttpService service = new HttpService("::1");
56+
ResponseMessage response = service.get("/");
57+
Assert.assertEquals(200, response.getStatus());
58+
Assert.assertTrue(firstLineIsXmlDtd(response.getContent()));
59+
60+
// IPv6 Host with the [] brackets
61+
HttpService newService = new HttpService("[::1]");
62+
ResponseMessage resp = newService.get("/");
63+
Assert.assertEquals(200, resp.getStatus());
64+
Assert.assertTrue(firstLineIsXmlDtd(resp.getContent()));
65+
}
66+
4467
@Test
4568
public void testGet() {
4669
ResponseMessage response = httpService.get("/");

0 commit comments

Comments
 (0)