title: HttpRequestException when using HttpClient on Dotnet Core on Raspbian
body: <p>while creating a Telegram Bot which is supposed to run on my Raspberry Pi, I am facing the following error when running code, which is using an underlying <code>HttpClient</code>:</p>
  
  <pre><code>System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---&gt; System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. ---&gt; System.TypeInitializationException: The type initializer for 'SslMethods' threw an exception. ---&gt; System.TypeInitializationException: The type initializer for 'Ssl' threw an exception. ---&gt; System.TypeInitializationException: The type initializer for 'SslInitializer' threw an exception. ---&gt; Interop+Crypto+OpenSslCryptographicException: error:0E076071:configuration file routines:MODULE_RUN:unknown module name
     at Interop.SslInitializer..cctor()
     --- End of inner exception stack trace ---
     at Interop.Ssl..cctor()
     --- End of inner exception stack trace ---
     at Interop.Ssl.SslV2_3Method()
     at Interop.Ssl.SslMethods..cctor()
     --- End of inner exception stack trace ---
     at Interop.OpenSsl.AllocateSslContext(SslProtocols protocols, SafeX509Handle certHandle, SafeEvpPKeyHandle certKeyHandle, EncryptionPolicy policy, SslAuthenticationOptions sslAuthenticationOptions)
     at System.Net.Security.SafeDeleteSslContext..ctor(SafeFreeSslCredentials credential, SslAuthenticationOptions sslAuthenticationOptions)
     at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteContext&amp; context, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, SslAuthenticationOptions sslAuthenticationOptions)
     --- End of inner exception stack trace ---
     at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, ExceptionDispatchInfo exception)
     at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
     at System.Net.Security.SslStream.BeginAuthenticateAsClient(SslClientAuthenticationOptions sslClientAuthenticationOptions, CancellationToken cancellationToken, AsyncCallback asyncCallback, Object asyncState)
     at System.Net.Security.SslStream.&lt;&gt;c.&lt;AuthenticateAsClientAsync&gt;b__47_0(SslClientAuthenticationOptions arg1, CancellationToken arg2, AsyncCallback callback, Object state)
     at System.Threading.Tasks.TaskFactory`1.FromAsyncImpl[TArg1,TArg2](Func`5 beginMethod, Func`2 endFunction, Action`1 endAction, TArg1 arg1, TArg2 arg2, Object state, TaskCreationOptions creationOptions)
     at System.Threading.Tasks.TaskFactory.FromAsync[TArg1,TArg2](Func`5 beginMethod, Action`1 endMethod, TArg1 arg1, TArg2 arg2, Object state, TaskCreationOptions creationOptions)
     at System.Threading.Tasks.TaskFactory.FromAsync[TArg1,TArg2](Func`5 beginMethod, Action`1 endMethod, TArg1 arg1, TArg2 arg2, Object state)
     at System.Net.Security.SslStream.AuthenticateAsClientAsync(SslClientAuthenticationOptions sslClientAuthenticationOptions, CancellationToken cancellationToken)
     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.Threading.Tasks.ValueTask`1.get_Result()
     at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
     at System.Threading.Tasks.ValueTask`1.get_Result()
     at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask)
     at System.Threading.Tasks.ValueTask`1.get_Result()
     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.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
     at Telegram.Bot.TelegramBotClient.SendWebRequestAsync[T](String method, Dictionary`2 parameters, CancellationToken cancellationToken)
     at Telegram.Bot.TelegramBotClient.ReceiveAsync(CancellationToken cancellationToken)
  </code></pre>
  
  <p>The whole program is running on .Net Core 2.2, and perfectly running on Windows.</p>
  
  <p>What I already tried was googling around for some similar problems, and someone proposed running this command:</p>
  
  <pre><code>sudo update-ca-certificates --fresh
  </code></pre>
  
  <p>as well as doing this:</p>
  
  <pre><code>export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
  export SSL_CERT_DIR=/dev/null
  </code></pre>
  
  <p>However, none of these fixed anything.</p>
  
  <p>So, what can I try to fix this?</p>