Skip to content

Commit 5fb57b5

Browse files
committed
Use SSL::VERSIONS to map the HTTP min_version:/max_version: (closes #497).
1 parent 32c1b59 commit 5fb57b5

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.rubocop.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,5 @@ Layout/IndentationConsistency:
141141
Exclude:
142142
# BUG: this seems like a bug in rubocop
143143
- 'lib/ronin/support/network/ssl.rb'
144+
# BUG: this seems like a bug in rubocop
145+
- 'lib/ronin/support/network/http.rb'

lib/ronin/support/network/http.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,14 @@ def initialize_ssl(ca_bundle: nil,
370370
version = SSL::VERSIONS.fetch(version,version)
371371

372372
@http.min_version = @http.max_version = version
373+
else min_version || max_version
374+
if min_version
375+
@http.min_version = SSL::VERSIONS.fetch(min_version,min_version)
376+
end
377+
378+
if max_version
379+
@http.max_version = SSL::VERSIONS.fetch(max_version,max_version)
380+
end
373381
end
374382

375383
@http.min_version = min_version if min_version

0 commit comments

Comments
 (0)