Skip to content

Commit

Permalink
Merge pull request #121 from yui-knk/remove_1_8_compatibility
Browse files Browse the repository at this point in the history
Remove 1 8 compatibility
  • Loading branch information
yui-knk committed Nov 27, 2018
2 parents cc5603c + 99bb7c6 commit 5c785c0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 21 deletions.
6 changes: 0 additions & 6 deletions README.md
Expand Up @@ -158,12 +158,6 @@ behaviors. These hooks are triggered using environment variables:
* show request and response of `HTTP`/`HTTPS` `GET` REST API calls;
* show request of `HTTP`/`HTTPS` `POST`/`PUT` REST API calls.

## 1.8 compatibility

Although we are trying to keep 1.8.7 compatibility as you can see it in
.travis.yml we don't officially support 1.8.7. The most important defect
on 1.8 is it does not support TLS only SSL endpoint.

## More Information

* Copyright: (c) 2011 Treasure Data Inc.
Expand Down
6 changes: 1 addition & 5 deletions spec/spec_helper.rb
Expand Up @@ -49,11 +49,7 @@
end

let :headers do
if RUBY_VERSION >= "2.0.0"
{'Accept' => '*/*', 'Accept-Encoding' => /gzip/, 'Date' => /.*/, 'User-Agent' => /Ruby/}
else
{'Accept' => '*/*', 'Date' => /.*/, 'User-Agent' => /Ruby/}
end
{'Accept' => '*/*', 'Accept-Encoding' => /gzip/, 'Date' => /.*/, 'User-Agent' => /Ruby/}
end

def stub_api_request(method, path, opts = nil)
Expand Down
17 changes: 7 additions & 10 deletions spec/td/client/api_ssl_connection_spec.rb
Expand Up @@ -43,16 +43,13 @@ def to_text
}.to raise_error OpenSSL::SSL::SSLError
end

# 1.8.7's net/http does not call SSLContext#set_params. Use 1.8.7 where you don't care security.
if RUBY_VERSION >= '1.9.0'
it 'should success to connect TLSv1 only server' do
@server = setup_server(:TLSv1)
api = API.new(nil, :endpoint => "https://localhost:#{@serverport}", :retry_post_requests => false)
api.ssl_ca_file = File.join(DIR, 'ca-all.cert')
expect {
api.delete_database('no_such_database')
}.to raise_error TreasureData::NotFoundError
end
it 'should success to connect TLSv1 only server' do
@server = setup_server(:TLSv1)
api = API.new(nil, :endpoint => "https://localhost:#{@serverport}", :retry_post_requests => false)
api.ssl_ca_file = File.join(DIR, 'ca-all.cert')
expect {
api.delete_database('no_such_database')
}.to raise_error TreasureData::NotFoundError
end

def setup_server(ssl_version)
Expand Down

0 comments on commit 5c785c0

Please sign in to comment.