-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 N°8115 - Unattended Install: unable to connect to MySQL with TLS #694
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, may as well make use of the return value of the connect method..
Co-authored-by: Thomas Casteleyn <[email protected]>
Co-authored-by: Thomas Casteleyn <[email protected]>
Co-authored-by: Thomas Casteleyn <[email protected]>
Accepted in functional review, it should be added in iTop 3.2.1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though the fix is relevant, it would be even more relevant to invoke CMDBSource::GetMysqliInstance
to do the job:
- This refactor is feasible because
GetMysqliInstance
is purely static. Note that it throws Exceptions in case of failure. - There is already another difference between the proposed implementation and the implementation of
GetMysqliInstance
that is relevant to all use cases. See the call to real_connect on line 186 that takes into account the PHP settingmysqli.default_socket
- We will automatically benefit from future improvements of
GetMysqliInstance
Thanks for the feedback @rquetiez , i copied the snippet exactly from that class, but I didn't know if coupling with core part was desirable. I'll implement the requested changes within a couple of days. |
Thank you for this contribution @tomrss 😊 |
Base information
Symptom (bug) / Objective (enhancement)
Unattended install process does not support TLS connections to MySQL.
Reproduction procedure (bug)
require_secure_transport=ON
db_tls.enabled
anddb_tls.ca
)setup/unattended-install/unattended-install.php
scriptCause (bug)
TLS connection not implemented in the unattended install script:
iTop/setup/unattended-install/unattended-install.php
Lines 220 to 221 in ea5473a
and
iTop/setup/unattended-install/unattended-install.php
Lines 313 to 314 in ea5473a
Proposed solution (bug and enhancement)
Add support for TLS connection based on this code in the docs and existing MySQL connection code in the app:
iTop/core/cmdbsource.class.inc.php
Lines 174 to 186 in ea5473a
Disclaimer: PHP is not my language, sorry if something is broken or strange! Just let me know and I'll fix it.
Checklist before requesting a review