Repository navigation
Commit 801c7df
committed
ssl: keep original SSLContext alive after servername_cb
Keep the original SSLContext in a separate instance variable to prevent
it from being GC'ed.
When the SNI callback accepts the provided server name, it may replace
the SSL_CTX with SSL_set_SSL_CTX() and update SSLSocket#context.
However, despite its name, SSL_set_SSL_CTX() does not use all
parameters from the new SSL_CTX. In particular, callbacks set by the
original SSL_CTX remain in use and therefore require the corresponding
SSLContext object to stay alive.1 parent 9796ee8 commit 801c7df
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
1694 | 1695 | | |
1695 | 1696 | | |
1696 | 1697 | | |
| 1698 | + | |
1697 | 1699 | | |
1698 | 1700 | | |
1699 | 1701 | | |
| |||
3359 | 3361 | | |
3360 | 3362 | | |
3361 | 3363 | | |
| 3364 | + | |
3362 | 3365 | | |
3363 | 3366 | | |
3364 | 3367 | | |
| |||
0 commit comments