View Ticket
Ticket Hash: 9afaf41635dd222b8e8cfaa0f3b61f0e52abd707
Title: tls::socket, but with shared SSL_CTX
Status: Open Type: Code Defect
Severity: Minor Priority: Immediate
Subsystem: Resolution: Open
Last Modified: 2025-10-11 21:39:23
19.0 days ago
Created: 2025-10-07 13:21:44
23.3 days ago
Version Found In: 1.8.0
User Comments:
anonymous added on 2025-10-07 13:21:44:

When opening a server socket with tls::socket -server, every time a client connects, a new SSL_CTX structure is created for that connection. This means, if certificates are provided with -certfile, -cafile and -keyfile, they are opened and read for every connection, as can be seen with strace. How do I avoid this?

  • Using -cert and -file instead requires a manual conversion of PEM-files to DER (and there is no equivalent for -cafile).
  • -model cannot be supplied to tls::socket, but this would require a weird workaround to get a "model connection" anyway.

Optimally tls::socket -server would cache the first SSL_CTX and use it for subsequent connections.


bohagan added on 2025-10-11 21:39:23:

I'm working on options to do this since it's also needed for session resumption. I don't have a time frame on when it would be available yet.