Splunk Dev

Using Splunk SDK for C#, getting errors regarding WebException and connection closure.

harrisflourentz
New Member

Hi,
I am new to Splunk (and new to Software Dev for that matter). My company uses splunkSDK (C#) nugget package to log data about user activity in one of our apps. I understand that this is an older version and now Splunk.Client should be used instead.

So I am trying to learn how to use Splunk SDK in order to access statistics about the log data fed into Splunk and display them in the app. That is why I am keen on running the examples first with a separate profile to avoid messing up the real data.

In the meantime, I have downloaded and installed the free Splunk Enterprise platform locally and went through the search examples.

I have downloaded the SDK for C#, compiled the solution, updated the dummy credentials to match my Splunk Enterprise trial profile, and tried to run any of the examples. I get the following error:

WebException: The underlying connection was closed: The connection was closed unexpectedly. with http
WebException: The request was aborted: Could not create SSL/TLS secure channel. with https

Note: The following curl command does successfully return an XML response, which would imply that authentication is achieved for the local Splunk Enterprise host that I have installed on my machine. (Obviously credentials are updated when the following was run)

curl -k https://localhost:8089/services/auth/login--data-urlencodeusername=admin--data-urlencodepassword=pas...

Please let me know if I am not specific enough so I can update the question. Thank you.

Labels (1)
0 Karma

jkat54
SplunkTrust
SplunkTrust

Unfortunately the C# sdk has been broken since the new auth mechanisms were put in place circa 7.1+

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...