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

Add an option to use certifications generated from localhost. #1296

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

junaruga
Copy link
Contributor

In the Fedora project, we are running the mysql2 tests on the build environment with a user permission, without root permission and without sudo.

In this case, we couldn't set up the custom domain "mysql2gem.example.com" required to run SSL tests. This feature to create a set of the certifications from the localhost gives an option to run the SSL tests executed in the environment.

How to generate the certificaton files:

$ cd spec/ssl/
$ bash gen_certs.sh

The files are generated in the spec/ssl/<host name>. Added the new files generated from the domain localhost in the spec/ssl/localhost.

How to use:

$ TEST_RUBY_MYSQL2_SSL_CERT_HOST=localhost \
  bundle exec rake spec

The implementation is similar with #1293 .

@junaruga junaruga marked this pull request as ready for review December 23, 2022 17:08
@junaruga
Copy link
Contributor Author

Rebasing this PR on the latest master branch. However, the #1293 is a higher priority for me. :)

@sodabrew
Copy link
Collaborator

sodabrew commented Feb 1, 2023

Since #1293 landed, is this PR still needed to build on it or close it out?

@junaruga
Copy link
Contributor Author

junaruga commented Feb 2, 2023

Since #1293 landed, is this PR still needed to build on it or close it out?

I think this PR is still needed. I rebased it on the latest master branch.

In Fedora's building environment, we cannot edit the /etc/hosts file to add the "mysql2gem.example.com". So, in the spec/mysql2/client_spec.rb, I want to set the host used to create the cert files by given environment variable, while currently the "mysql2gem.example.com" is hard-coded. What do you think?

In the Fedora project, we are running the mysql2 tests on the build environment
with a user permission, without root permission and without `sudo`.

In this case, we couldn't set up the custom domain "mysql2gem.example.com"
required to run SSL tests. This feature to create a set of the certifications
from the localhost gives an option to run the SSL tests executed in the environment.

How to generate the certificaton files:

```
$ cd spec/ssl/
$ bash gen_certs.sh
```

The files are generated in the `spec/ssl/<host name>`. Added the new files
generated from the domain localhost in the `spec/ssl/localhost`.

How to use:

```
$ TEST_RUBY_MYSQL2_SSL_CERT_HOST=localhost \
  bundle exec rake spec
```
@junaruga
Copy link
Contributor Author

junaruga commented Feb 8, 2023

Do you have any concerns or needs about the PR? If you have those, I am happy to think an alternative way again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants