<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jul 15, 2016 at 10:01 AM, Gregory Szorc <span dir="ltr"><<a href="mailto:gregory.szorc@gmail.com" target="_blank">gregory.szorc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div class="h5"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jul 15, 2016 at 6:09 AM, Yuya Nishihara <span dir="ltr"><<a href="mailto:yuya@tcha.org" target="_blank">yuya@tcha.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Thu, 14 Jul 2016 21:09:06 -0700, Gregory Szorc wrote:<br>
> # HG changeset patch<br>
> # User Gregory Szorc <<a href="mailto:gregory.szorc@gmail.com" target="_blank">gregory.szorc@gmail.com</a>><br>
> # Date 1468552459 25200<br>
> #      Thu Jul 14 20:14:19 2016 -0700<br>
> # Node ID e0c8977678cca5a1ceb8174ecd347810482f6656<br>
> # Parent  99d9188b9d45039a06c65fa7dda36a12d08369c2<br>
> sslutil: implement wrapserversocket()<br>
><br>
> wrapsocket() is heavily tailored towards client use. In preparation<br>
> for converting the built-in server to use sslutil (as opposed to<br>
> the ssl module directly), we add wrapserversocket() for wrapping<br>
> a socket to be used on servers.<br>
><br>
> Again, we can't use ssl.create_default_context() because of CA control<br>
> concerns. So we basically implement it inline.<br>
<br>
</span>I think create_default_context() can be used here because the purpose is<br>
CLIENT_AUTH, which doesn't set CERT_REQUIRED, and the system CA certs are<br>
not loaded automatically.<br>
</blockquote></div><br></div></div></div><div class="gmail_extra">You are correct: create_default_context() is usable for server sockets. I'll send a V5 series.<br></div></div>
</blockquote></div><br></div><div class="gmail_extra">... except in a subsequent patch where we need to configure an explicit protocol version we can't use create_default_context(). At that point we have 3 code paths for creating the context - 2 for modern ssl and 1 for legacy. I'm tempted to leave this implementation for now and follow-up to use create_default_context(). But I can tweak the comment. So I'll still send a V5.<br></div></div>