HSLHttp Library Auth Issue

Hi all, I was wondering if anyone else has had issues with authentication on the Http library? I’m attempting to connect to the Benchling API; the same credentials/command works perfectly in python but I keep getting auth issues when I try to use it in venus - both with basic and bearer auth. Has anyone seen this before and has a fix?

Thanks

What’s your exact error? 403 or 401 or something?

Doesn’t give me a standard error code as far as I can see; the trace result is as follows:

Response Status Code: 0 2025-03-05 15:14:26> HSLHttp : HttpPOST - progress; Response Content: System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Authentication failed because the remote party has closed the transport stream. at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult) at System.Net.PooledStream.EndWrite(IAsyncResult asyncResult) at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context) at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar) --- End of inner exception stack trace ---

have you resolved the problem yet?

SetAuthenticationr in HSLHttp supports basic auth and bearer token:
HSLHttp::Authentication_None
HSLHttp::Authentication_Basic
HSLHttp::Authentication_BearerToken

we have our own server and bearer token for auth, so we just set the i_auth to be “HSLHttp::Authentication_BearerToken”, and set bearer token for the i_passwordOrToken.

I have never used benching API, but the documentation shows it’s just typical basic auth or bearer token.

1 Like

Problem hasn’t been resolved, and I tried doing both bearer token and basic auth as you’ve described/as described in the benchling API

Hi @theonetruenerd,

What version of the Http Library are you using? According to some internet research, the error you received “Authentication failed because the remote party has closed the transport stream” is almost guaranteed to be due to a Security Protocol Type mismatch (i.e. SSL/TLS). Depending on the version of Http library in use, the Security Protocol Type is either being set directly in the library itself or being pulled from your PC, and is likely too low for Benchling’s requirements.

Thank you,
Dan

1 Like

v2.6, which according the library HSL changelog should have support for TLS 1.2, which should be compatible with Benchling as far as I can see. Having said that, I can’t see which version of TLS the object itself is actually using, only that the HSL changelog says it has been updated to use TLS 1.2

Hi @theonetruenerd,

I would suggest switching to the HSLHttp Library v2.7, which was updated to use the Security Protocol set by the OS rather than a static protocol. It can be downloaded at this link. It also wouldn’t hurt to check what level of protocol your Python script is using as that may shed some light on what’s needed.

Thank you,
Dan

1 Like