Repository navigation
Commit dda31e3
Alex Choulos
Cache SSL_CREDENTIAL selected during handshake so getSelectedCredential works post-handshake
SSL_get0_selected_credential reads the handshake state, which BoringSSL frees
before SSL_do_handshake returns, so SSL.getSelectedCredential always returned 0
once the handshake completed.
Sample the credential in ssl_info_callback on SSL_CB_HANDSHAKE_DONE, hold a ref in
tcn_ssl_state_t and release it in free_ssl_state. On renegotiation the previous
ref is released and replaced, so the cache reflects the most recent completed
handshake. getSelectedCredential tries the live lookup first (non-NULL only while
the handshake state exists) and falls back to the cached credential.1 parent 91e525b commit dda31e3
4 files changed
Lines changed: 38 additions & 1 deletion
File tree
- openssl-classes/src/main/java/io/netty/internal/tcnative
- openssl-dynamic/src/main/c
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
997 | 997 | | |
998 | 998 | | |
999 | 999 | | |
1000 | | - | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
1001 | 1004 | | |
1002 | 1005 | | |
1003 | 1006 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
933 | 933 | | |
934 | 934 | | |
935 | 935 | | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
936 | 943 | | |
937 | 944 | | |
938 | 945 | | |
| |||
2763 | 2770 | | |
2764 | 2771 | | |
2765 | 2772 | | |
| 2773 | + | |
| 2774 | + | |
| 2775 | + | |
| 2776 | + | |
| 2777 | + | |
| 2778 | + | |
| 2779 | + | |
2766 | 2780 | | |
2767 | 2781 | | |
2768 | 2782 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
414 | 418 | | |
415 | 419 | | |
416 | 420 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
192 | 208 | | |
193 | 209 | | |
194 | 210 | | |
| |||
0 commit comments