Splunk Dev

Java to Splunk Cloud connection error: HttpService.setSslSecurityProtocol

kartik037
Engager

I'm trying to connect splunk through java 8 application. While making a connection to splunk cloud, i'm getting below error at

HttpService.setSslSecurityProtocol(SSLSecurityProtocol.TLSv1_2) line . Can any one provide the solution ?

Error: java.lang.NoSuchMethodError: com.splunk.SSLSecurityProtocol.(Ljava/lang/String;ILcom/splunk/SSLSecurityProtocol;)V at com.splunk.SSLSecurityProtocol$2.(SSLSecurityProtocol.java:7) ~[splunk-1.6.2.0.jar!/:1.6.2] at com.splunk.SSLSecurityProtocol.(SSLSecurityProtocol.java:7) ~[splunk-1.6.2.0.jar!/:1.6.2]

Tags (2)
0 Karma

mianmembrebe
Explorer

i'm also encountering this error (yes, still an error even though HttpService.setSslSecurityProtocol(SSLSecurityProtocol.TLSv1_2); was in the code)
hopefully someone can help us with this

0 Karma

kartik037
Engager

Which version of splunk dependency you are using ? I solved this problem by using 1.6.3.0 version or latest . Earlier I used 1.6.2.0 when I encountered above error. Use the latest version of splunk.
Maven:

<groupId>com.splunk</groupId>
<artifactId>splunk</artifactId>
<version>1.6.3.0</version>

mianmembrebe
Explorer

That did the trick for me too! Thanks!

rajeshhertz
New Member

I am not sure whether you have included the below line in your java code. If not, try to add it in code and compile again. Please let me know if you are successfully getting your query response.

HttpService.setSslSecurityProtocol(SSLSecurityProtocol.TLSv1_2);

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...