File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed
fixtures/output/ruby/native Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,10 @@ module.exports = function (source, options) {
3434
3535 if ( source . uriObj . protocol === 'https:' ) {
3636 code . push ( 'http.use_ssl = true' )
37- . push ( 'http.verify_mode = OpenSSL::SSL::VERIFY_NONE' )
37+
38+ if ( options . insecureSkipVerify ) {
39+ code . push ( 'http.verify_mode = OpenSSL::SSL::VERIFY_NONE' )
40+ }
3841 }
3942
4043 code . blank ( )
Original file line number Diff line number Diff line change 66
77http = Net ::HTTP . new ( url . host , url . port )
88http . use_ssl = true
9- http . verify_mode = OpenSSL ::SSL ::VERIFY_NONE
109
1110request = Net ::HTTP ::Get . new ( url )
1211
Original file line number Diff line number Diff line change 11'use strict'
22
3- module . exports = function ( snippet , fixtures ) { }
3+ module . exports = function ( HTTPSnippet , fixtures ) {
4+ it ( 'should support insecureSkipVerify' , function ( ) {
5+ const result = new HTTPSnippet ( fixtures . requests . https ) . convert ( 'ruby' , 'native' , {
6+ insecureSkipVerify : true
7+ } )
8+
9+ result . should . be . a . String ( )
10+ result . should . eql ( `require 'uri'
11+ require 'net/http'
12+ require 'openssl'
13+
14+ url = URI("https://mockbin.com/har")
15+
16+ http = Net::HTTP.new(url.host, url.port)
17+ http.use_ssl = true
18+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
19+
20+ request = Net::HTTP::Get.new(url)
21+
22+ response = http.request(request)
23+ puts response.read_body` )
24+ } )
25+ }
You can’t perform that action at this time.
0 commit comments