<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Joseph King</title>
    <description>The latest articles on DEV Community by Joseph King (@josephanthonyking).</description>
    <link>https://dev.to/josephanthonyking</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F905373%2F9ad39485-eb3a-4916-b4cf-6c2f35a6844b.png</url>
      <title>DEV Community: Joseph King</title>
      <link>https://dev.to/josephanthonyking</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/josephanthonyking"/>
    <language>en</language>
    <item>
      <title>Connect Heroku Redis V6 to .Net Core Heroku App hosted through Docker</title>
      <dc:creator>Joseph King</dc:creator>
      <pubDate>Thu, 26 Jan 2023 22:48:27 +0000</pubDate>
      <link>https://dev.to/josephanthonyking/connect-heroku-redis-v6-to-net-core-heroku-app-hosted-through-docker-ob1</link>
      <guid>https://dev.to/josephanthonyking/connect-heroku-redis-v6-to-net-core-heroku-app-hosted-through-docker-ob1</guid>
      <description>&lt;p&gt;I have a staging .Net Core app hosted on Heroku via Docker which uses the Heroku Redis addon as a cache.  Heroku recently upgrade all mini plans to version 6 and I understand version 6 requires a TLS connection... sorry if I'm getting this wrong.&lt;/p&gt;

&lt;p&gt;In any case, I can't start the app due to the following error from StackExchange.Redis:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Timeout performing SUBSCRIBE (5000ms), inst: 4, qu: 1, qs: 0, aw: False, bw: SpinningDown, serverEndpoint: [amazon ecs endpoint here], mc: 1/1/0, mgr: 10 of 10 available, clientName: 319aa5ff-317f-42e6-9a2e-d0c8e0be9020(SE.Redis-v2.6.66.47313), IOCP: (Busy=0,Free=1000,Min=1,Max=1000), WORKER: (Busy=0,Free=32767,Min=8,Max=32767), POOL: (Threads=6,QueuedItems=0,CompletedItems=302), v: 2.6.66.47313 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I've tried validating the server certificate with the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private static ConfigurationOptions GetHerokuRedisConfigurationOptions(string host, int port, string password)
{

    var config = new ConfigurationOptions
    {
        ConnectRetry = 3,
        AbortOnConnectFail = false,
        Ssl = true,
        Password = password,
        EndPoints = { { host, port } }
    };

    config.CertificateValidation += ValidateServerCertificate;

    return config;
}

private static bool ValidateServerCertificate(
object sender,
X509Certificate certificate,
X509Chain chain,
SslPolicyErrors sslPolicyErrors)
{
    if (sslPolicyErrors == SslPolicyErrors.None)
        return true;

    Console.WriteLine("Certificate error: {0}", sslPolicyErrors);

    return false;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This produces the following error:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Certificate error: RemoteCertificateNameMismatch, RemoteCertificateChainErrors&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;How can I configure the TLS connection in StackExchange.Redis in order to connect to the Heroku Redis Data addon?&lt;/p&gt;

&lt;p&gt;Thank you!&lt;br&gt;
Joe&lt;/p&gt;

</description>
      <category>help</category>
      <category>heroku</category>
      <category>dotnetcore</category>
    </item>
  </channel>
</rss>
