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!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...