Bug #86278 | Support custom construction of SSLSocket during connection establishment | ||
---|---|---|---|
Submitted: | 11 May 2017 6:16 | Modified: | 10 Apr 2018 1:48 |
Reporter: | Jason Rahman | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / J | Severity: | S4 (Feature request) |
Version: | 6.0.6 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[11 May 2017 6:16]
Jason Rahman
[17 May 2017 11:41]
Alexander Soklakov
Hi Jason, Thanks for this request, we really should consider this functionality.
[14 Jun 2017 17:25]
Jason Rahman
Some further details, the exact issue in the code is that ConnectionImpl calls MysqlIO.doHandshake() here: https://github.com/mysql/mysql-connector-j/blob/1f61b0b0270d9844b006572ba4e77f19c0f230d4/s... MysqlIO.doHandshake() calls MysqlIO.negotiateSSLConnection() either here: https://github.com/mysql/mysql-connector-j/blob/83c6dc41b96809df81444362933043b20a1d49d5/s... or here: https://github.com/mysql/mysql-connector-j/blob/83c6dc41b96809df81444362933043b20a1d49d5/s... SocketFactory.afterHandshake() isn't called until this point: https://github.com/mysql/mysql-connector-j/blob/83c6dc41b96809df81444362933043b20a1d49d5/s... So the call to SocketFactory.afterHandshake() is after MysqlIO.negotiateSSLConnection() was called which is when the SSLSocket is created and the SSL negotiation occurs.
[10 Apr 2018 1:48]
Daniel So
Posted by developer: Added the following entry to the C/J 8.0.11 changelog: "Connector/J now supports the use of a custom SSLSocketFactory for returning a custom-constructed SSL socket at the time of connection establishment."