Skip to content
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

mysqli ssl_key and ssl_cert should not be mandatory #2815

Closed
gauauu opened this issue Aug 11, 2017 · 3 comments
Closed

mysqli ssl_key and ssl_cert should not be mandatory #2815

gauauu opened this issue Aug 11, 2017 · 3 comments

Comments

@gauauu
Copy link
Contributor

gauauu commented Aug 11, 2017

In MysqliConnection.php, in setSecureConnection, there's a clause that ensures that ssl_key and ssl_cert are set.

I have a mysql connection that needs an ssl_ca to be specified, but doesn't need ssl_key or ssl_cert. I've been using this connection succefully (without this library) with this call:

$db->ssl_set(null, null, '/etc/msqlcacert.pem', null, null);

But with the error checking here, I can't do that.

If I hack MysqliConnection.php to remove the "mandatory" check, and set ssl_key and ssl_cert to optional, it works on my connection:

		$this->_conn->ssl_set(
			$params['ssl_key'] ?? null,
			$params['ssl_cert'] ?? null,
			$params['ssl_ca']     ?? null,
			$params['ssl_capath'] ?? null,
			$params['ssl_cipher'] ?? null
		);

Thanks!

@gauauu
Copy link
Contributor Author

gauauu commented Aug 11, 2017

BTW, I'm happy to make a PR with the changes unless there's a reason I'm wrong or unless dbal shouldn't support this usage for some reason.

@Ocramius
Copy link
Member

@gauauu this is possibly a regression, so go ahead and send a patch if you can 👍

@github-actions
Copy link

github-actions bot commented Aug 3, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants