<h1 dir="auto">Checklist</h1>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?utf8=%E2%9C%93&amp;q=is%3Aissue+label%3A%22Issue+Type%3A+Feature+Request%22+">issues list</a><br>
for similar or identical feature requests.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?utf8=%E2%9C%93&amp;q=is%3Apr+label%3A%22PR+Type%3A+Feature%22+">pull requests list</a><br>
for existing proposed implementations of this feature.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/commits/main">commit log</a><br>
to find out if the same feature was already implemented in the<br>
main branch.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all related issues and possible duplicate issues<br>
in this issue (If there are none, check this box anyway).</li>
</ul>
<h2 dir="auto">Related Issues and Possible Duplicates</h2>

<h4 dir="auto">Related Issues</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h1 dir="auto">Brief Summary</h1>

<p dir="auto">We have a requirement to run celery tasks in a python 3.11 environment (other dependencies require python 3.11). Could python 3.11 be supported?</p>
<h1 dir="auto">Design</h1>
<h2 dir="auto">Architectural Considerations</h2>

<p dir="auto">None</p>
<h2 dir="auto">Proposed Behavior</h2>

<h2 dir="auto">Proposed UI/UX</h2>

<h2 dir="auto">Diagrams</h2>

<p dir="auto">N/A</p>
<h2 dir="auto">Alternatives</h2>

<p dir="auto">None</p>
<h1 dir="auto">Checklist</h1>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Enhancement%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br>
for similar or identical enhancement to an existing feature.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22Issue+Type%3A+Enhancement%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br>
for existing proposed enhancements.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br>
to find out if the if the same enhancement was already implemented in the<br>
master branch.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all related issues and possible duplicate issues in this issue<br>
(If there are none, check this box anyway).</li>
</ul>
<h2 dir="auto">Related Issues and Possible Duplicates</h2>

<h4 dir="auto">Related Issues</h4>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="417799131" data-permission-text="Title is private" data-url="https://github.com/celery/celery/issues/5371" data-hovercard-type="issue" data-hovercard-url="/celery/celery/issues/5371/hovercard" href="https://github.com/celery/celery/issues/5371">#5371</a> this issue has to do with confusion about specifying <code class="notranslate">ssl_cert_reqs</code> as a constant (<code class="notranslate">ssl.CERT_REQUIRED</code> versus a string <code class="notranslate">'CERT_REQUIRED'</code>.)</li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h1 dir="auto">Brief Summary</h1>

<p dir="auto">The official redis python library expects <code class="notranslate">ssl_cert_reqs</code> to be one of: <code class="notranslate">'none'</code>, <code class="notranslate">'optional'</code>, or <code class="notranslate">'required'</code>.</p>
<p dir="auto">See: <a href="https://github.com/andymccurdy/redis-py/blob/3.3.7/redis/connection.py#L793">https://github.com/andymccurdy/redis-py/blob/3.3.7/redis/connection.py#L793</a></p>
<p dir="auto">Celery expects this to be one of <code class="notranslate">'CERT_NONE'</code>, <code class="notranslate">'CERT_OPTIONAL'</code>, or <code class="notranslate">'CERT_REQUIRED'</code>.</p>
<p dir="auto">This can lead to confusion because the same redis URL cannot be used for both celery, with a redis backend, and redis directly.</p>
<p dir="auto">For example, the following redis urls are incompatible:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;rediss://:${REDIS_TOKEN}@${REDIS_HOST}?ssl_cert_reqs=none&quot;  # works for redis, not celery
&quot;rediss://:${REDIS_TOKEN}@${REDIS_HOST}?ssl_cert_reqs=CERT_NONE&quot;  # works for celery, not redis"><pre class="notranslate"><span class="pl-s"><span class="pl-pds">"</span>rediss://:<span class="pl-smi">${REDIS_TOKEN}</span>@<span class="pl-smi">${REDIS_HOST}</span>?ssl_cert_reqs=none<span class="pl-pds">"</span></span>  <span class="pl-c"><span class="pl-c">#</span> works for redis, not celery</span>
<span class="pl-s"><span class="pl-pds">"</span>rediss://:<span class="pl-smi">${REDIS_TOKEN}</span>@<span class="pl-smi">${REDIS_HOST}</span>?ssl_cert_reqs=CERT_NONE<span class="pl-pds">"</span></span>  <span class="pl-c"><span class="pl-c">#</span> works for celery, not redis</span></pre></div>
<p dir="auto">This confusion could be avoided by reconciling the two formats.</p>
<p dir="auto">To avoid future confusion, and remaining backward compatible, I propose <em>at a minimum</em> letting celery recognize the redis <code class="notranslate">ssl_cert_reqs</code> strings.</p>
<p dir="auto">Ideally, the documentation would also be updated to prefer the standard redis strings (mentioning that the <code class="notranslate">CERT_*</code> strings are also valid but deprecated).</p>
<h1 dir="auto">Design</h1>
<h2 dir="auto">Architectural Considerations</h2>

<p dir="auto">None</p>
<h2 dir="auto">Proposed Behavior</h2>

<p dir="auto">Change celery to map both formats to the same value, such as:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="            ssl_string_to_constant = {'CERT_REQUIRED': CERT_REQUIRED,
                                      'CERT_OPTIONAL': CERT_OPTIONAL,
                                      'CERT_NONE': CERT_NONE,
                                      'required': CERT_REQUIRED,
                                      'optional': CERT_OPTIONAL,
                                      'none': CERT_NONE}"><pre class="notranslate">            <span class="pl-s1">ssl_string_to_constant</span> <span class="pl-c1">=</span> {<span class="pl-s">'CERT_REQUIRED'</span>: <span class="pl-v">CERT_REQUIRED</span>,
                                      <span class="pl-s">'CERT_OPTIONAL'</span>: <span class="pl-v">CERT_OPTIONAL</span>,
                                      <span class="pl-s">'CERT_NONE'</span>: <span class="pl-v">CERT_NONE</span>,
                                      <span class="pl-s">'required'</span>: <span class="pl-v">CERT_REQUIRED</span>,
                                      <span class="pl-s">'optional'</span>: <span class="pl-v">CERT_OPTIONAL</span>,
                                      <span class="pl-s">'none'</span>: <span class="pl-v">CERT_NONE</span>}</pre></div>
<h2 dir="auto">Proposed UI/UX</h2>

<h2 dir="auto">Diagrams</h2>

<p dir="auto">N/A</p>
<h2 dir="auto">Alternatives</h2>

<p dir="auto">Live with the disparity of URL formats and make it painfully clear in the documentation that celery's choice is non-standard.</p>