bundler: Fix Bundler::Fetcher for PQC support, adding integration connection tests#9637
Draft
junaruga wants to merge 1 commit into
Draft
bundler: Fix Bundler::Fetcher for PQC support, adding integration connection tests#9637junaruga wants to merge 1 commit into
junaruga wants to merge 1 commit into
Conversation
26faa7a to
1f63f18
Compare
4 tasks
Member
Author
|
CI ruby-core cases failed. https://github.com/ruby/rubygems/actions/runs/28041447077/job/83008544582?pr=9637 |
Member
Author
I am testing by adding the 3rd commit. |
0284301 to
e578fea
Compare
Member
Author
I fixed the ruby-core cases. In CI Bundler on macOS ruby-4.0, ruby-3.2 cases, the following non-PQC/PQC tests failed. Investigating. https://github.com/ruby/rubygems/actions/runs/28050419021/job/83039282611?pr=9637#step:12:109 |
0f983e4 to
eca36c3
Compare
…nection tests
Created spec/bundler/fetcher/gem_remote_fetcher_local_ssl_server_spec.rb
adding non-PQC and PQC server/client connection integration tests.
As "Bundler::Fetcher local SSL server #connection PQC connects with client cert
auth" failed with the following error due to hardcoded `OpenSSL::PKey::RSA.new` in
`Bundler::Fetcher#connection`, fixed it to support ML-DSA ssl_client_cert.
```
$ bin/rspec spec/bundler/fetcher/gem_remote_fetcher_local_ssl_server_spec.rb
...
Failures:
1) Bundler::Fetcher local SSL server #connection PQC connects with client cert auth
Failure/Error: fetcher = Bundler::Fetcher.new(remote)
OpenSSL::PKey::PKeyError:
incorrect pkey type: UNDEF
# /home/jaruga/.local/ruby-4.1.0-debug-3ef48ef9c8-openssl-4.1.0-7194354488/lib/ruby/4.1.0+1/openssl/pkey.rb:394:in 'OpenSSL::PKey::RSA#initialize'
# /home/jaruga/.local/ruby-4.1.0-debug-3ef48ef9c8-openssl-4.1.0-7194354488/lib/ruby/4.1.0+1/openssl/pkey.rb:394:in 'Class#new'
# /home/jaruga/.local/ruby-4.1.0-debug-3ef48ef9c8-openssl-4.1.0-7194354488/lib/ruby/4.1.0+1/openssl/pkey.rb:394:in 'OpenSSL::PKey::RSA.new'
# ./bundler/lib/bundler/fetcher.rb:321:in 'Bundler::Fetcher#connection'
# ./bundler/lib/bundler/fetcher.rb:140:in 'Bundler::Fetcher#initialize'
# ./spec/bundler/fetcher/gem_remote_fetcher_local_ssl_server_spec.rb:69:in 'RSpec::ExampleGroups::BundlerFetcherLocalSSLServer#fetch_path'
# ./spec/bundler/fetcher/gem_remote_fetcher_local_ssl_server_spec.rb:60:in 'block (4 levels) in <top (required)>'
...
```
Created test/rubygems/local_ssl_server_utilities.rb to manage utility methods
called by RubyGems test-unit and Bundler rspec tests.
Co-Authored-By: Claude <noreply@anthropic.com>
eca36c3 to
c245713
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR is related to #9543. The first commit is the same with #9615. I want to see the #9615 is reviewed and merged. After that, I will rebase this PR on the latest master branch. The second commit is this PR's commit.
Created spec/bundler/fetcher/gem_remote_fetcher_local_ssl_server_spec.rb adding non-PQC and PQC server/client connection integration tests.
As "Bundler::Fetcher local SSL server #connection PQC connects with client cert auth" failed with the following error due to hardcoded
OpenSSL::PKey::RSA.newinBundler::Fetcher#connection, fixed it to support ML-DSA ssl_client_cert.Created test/rubygems/local_ssl_server_utilities.rb to manage utility methods
called by RubyGems test-unit and Bundler rspec tests.
Co-Authored-By: Claude noreply@anthropic.com
Files
spec/bundler/fetcher/gem_remote_fetcher_local_ssl_server_spec.rb
I aligned the file structure with
test/rubygems/test_gem_remote_fetcher_local_ssl_server.rb. I also referred tospec/bundler/fetcher/gem_remote_fetcher_spec.rb.test/rubygems/local_ssl_server_utilities.rb
For the file's naming, I referred to
test/rubygems/multifactor_auth_utilities.rb, there are following files as support files, I thinktest/rubygems/*_utilities.rbfile is suitable in this case in my opinion.What was the end-user or developer problem that led to this PR?
Bundler::Fetcher#connectiondoesn't work with ML-DSA ssl_client_cert due to hardcodedOpenSSL::PKey::RSA.new.What is your fix for the problem, implemented in this PR?
Fixed the
Bundler::Fetcher#connectionto support ML-DSA ssl_client_cert.Added integration HTTPS server/client connection tests.
Make sure the following tasks are checked