Skip to content

Commit 7de566c

Browse files
committed
Update HttpService.java
updating SSL_SOCKET_FACTORY on changing validateCertificates flag.
1 parent 00cd195 commit 7de566c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,12 @@ public static SSLSocketFactory getSSLSocketFactory() {
558558
return HttpService.sslSocketFactory;
559559
}
560560

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

565569
public static SSLSocketFactory createSSLFactory() {

0 commit comments

Comments
 (0)