ruby / ruby/net-http

HTTPS proxy is only enabled if the proxied connection is also SSL

Open
#210 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
148
Forks
95
Avg merge
10h 54m
Merged PRs (30d)
4

Description

irb(main):001> require 'net/http'
=> true
irb(main):002> n = Net::HTTP.new('192.0.2.10', 80, '127.0.0.1', 5000, nil, nil, nil, true)
=> #<Net::HTTP 192.0.2.10:80 open=false>
irb(main):003> n.instance_variable_get(:@proxy_use_ssl)
=> true
irb(main):004> n.start
=> #<Net::HTTP 192.0.2.10:80 open=true>
irb(main):005> n.get('/')

Data sent to the listener at 127.0.0.1:5000:

GET http://192.0.2.10/ HTTP/1.1
Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept: */*
User-Agent: Ruby
Host: 192.0.2.10

This is due to the proxy SSL socket setup being inside a if use_ssl? block.

https://github.com/ruby/net-http/blob/master/lib/net/http.rb#L1667-L1674

Transporting clear HTTP over a HTTPS proxy is a valid configuration, the library should support this.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lib/net/http.rb around lines 1667-1674 and reproduce the reported Net::HTTP configuration with a clear HTTP target and HTTPS proxy. Trace the proxy socket setup and verify that clear HTTP requests can be transported through an HTTPS proxy without changing the target connection. Confirm the behavior with a focused regression test using the shown configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.