Commit a8f8f4a
committed
Fix SNI not being set on SSLSocket when using connect timeout
Under BCJSSE (Bouncy Castle JSSE provider), creating an unconnected
SSLSocket via createSocket() and then calling connect(InetSocketAddress)
does not automatically propagate the hostname for SNI. This causes TLS
handshake failures against endpoints that require SNI for certificate
selection (e.g. AWS OpenSearch managed domains behind load balancers).
The fix explicitly sets SNI server names via SSLParameters before
connecting, which works correctly with both SunJSSE and BCJSSE.
Closes #765
Signed-off-by: Sotaro Hikita <bering1814@gmail.com>1 parent 525183e commit a8f8f4a
1 file changed
Lines changed: 11 additions & 0 deletions
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| 49 | + | |
47 | 50 | | |
| 51 | + | |
| 52 | + | |
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
| |||
142 | 147 | | |
143 | 148 | | |
144 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
145 | 156 | | |
146 | 157 | | |
147 | 158 | | |
| |||
0 commit comments