I’m having a similar issue as well, I’ve been trying to diagnose all weekend. I’m using the paper trading API version 3.8.3 and a call to “.GetBarSetAsync()” returns this:
System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
—> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception.
—> System.ComponentModel.Win32Exception (0x80090326): The message received was unexpected or badly formatted.
— End of inner exception stack trace —
at System.Net.Security.SslStream.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, ExceptionDispatchInfo exception)
at System.Net.Security.SslStream.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslStream.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslStream.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslStream.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslStream.PartialFrameCallback(AsyncProtocolRequest asyncRequest)
— End of stack trace from previous location where exception was thrown —
at System.Net.Security.SslStream.ThrowIfExceptional()
at System.Net.Security.SslStream.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.Security.SslStream.EndProcessAuthentication(IAsyncResult result)
at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)
at System.Net.Security.SslStream.<>c.b__65_1(IAsyncResult iar)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
— End of stack trace from previous location where exception was thrown —
at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
— End of inner exception stack trace —
at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) at Alpaca.Markets.HttpClientExtensions.sendThrottledAsync(HttpClient httpClient, HttpRequestMessage request, CancellationToken cancellationToken, IThrottler throttler) at Alpaca.Markets.HttpClientExtensions.callAndDeserializeAsync[TApi,TJson](HttpClient httpClient, HttpRequestMessage request, CancellationToken cancellationToken, IThrottler throttler) at Alpaca.Markets.HttpClientExtensions.callAndDeserializeAsync[TApi,TJson](HttpClient httpClient, HttpMethod method, Uri endpointUri, CancellationToken cancellationToken, IThrottler throttler) at Alpaca.Markets.HttpClientExtensions.GetAsync[TKeyApi,TValueApi,TKeyJson,TValueJson](HttpClient httpClient, UriBuilder uriBuilder, IEqualityComparer1 comparer, CancellationToken cancellationToken)
My program has been running for several months and had no issues until recently. If anyone knows what this is, assistance would also be greatly appreciated.
Thanks,
Steve