Skip to content

Commit

Permalink
Merge branch '1.0' of https://github.com/lostisland/faraday into feat…
Browse files Browse the repository at this point in the history
…ure/#762-rspec

# Conflicts:
#	lib/faraday/utils.rb
  • Loading branch information
iMacTia committed Oct 29, 2018
2 parents 62d3f95 + a37f8c5 commit 89df1a1
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 4 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -2,7 +2,6 @@ sudo: false
language: ruby
cache: bundler
rvm:
- 2.2
- 2.3
- 2.4
- 2.5
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -354,7 +354,7 @@ stubs.verify_stubbed_calls
This library aims to support and is [tested against][travis] the following Ruby
implementations:

* Ruby 2.2+
* Ruby 2.3+

If something doesn't work on one of these Ruby versions, it's a bug.

Expand All @@ -372,7 +372,7 @@ of a major release, support for that Ruby version may be dropped.
## Contribute

Do you want to contribute to Faraday?
Open the issues page and check for the `any volunteer?` label!
Open the issues page and check for the `help wanted` label!
But before you start coding, please read our [Contributing Guide](https://github.com/lostisland/faraday/blob/master/.github/CONTRIBUTING.md)

## Copyright
Expand Down
2 changes: 1 addition & 1 deletion UPGRADING.md
@@ -1,7 +1,7 @@
## Faraday 1.0

* Dropped support for jruby and Rubinius.
* Officially supports Ruby 2.2+
* Officially supports Ruby 2.3+
* In order to specify the adapter you now MUST use the `#adapter` method on the connection builder. If you don't do so and your adapter inherits from `Faraday::Adapter` then Faraday will raise an exception. Otherwise, Faraday will automatically push the default adapter at the end of the stack causing your request to be executed twice.
```ruby
class OfficialAdapter < Faraday::Adapter
Expand Down
42 changes: 42 additions & 0 deletions lib/faraday/options.rb
Expand Up @@ -218,14 +218,56 @@ def stream_response?
end
end

# SSL-related options.
#
# @!attribute verify
# @return [Boolean] whether to verify SSL certificates or not
#
# @!attribute ca_file
# @return [String] CA file
#
# @!attribute ca_path
# @return [String] CA path
#
# @!attribute verify_mode
# @return [String] Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html)
#
# @!attribute cert_store
# @return [OpenSSL::X509::Store] certificate store
#
# @!attribute client_cert
# @return [String, OpenSSL::X509::Certificate] client certificate
#
# @!attribute client_key
# @return [String, OpenSSL::PKey::RSA, OpenSSL::PKey::DSA] client key
#
# @!attribute certificate
# @return [OpenSSL::X509::Certificate] certificate (Excon only)
#
# @!attribute private_key
# @return [OpenSSL::PKey::RSA, OpenSSL::PKey::DSA] private key (Excon only)
#
# @!attribute verify_depth
# @return [Integer] maximum depth for the certificate chain verification
#
# @!attribute version
# @return [String, Symbol] SSL version (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html#method-i-ssl_version-3D)
#
# @!attribute min_version
# @return [String, Symbol] minimum SSL version (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html#method-i-min_version-3D)
#
# @!attribute max_version
# @return [String, Symbol] maximum SSL version (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html#method-i-max_version-3D)
class SSLOptions < Options.new(:verify, :ca_file, :ca_path, :verify_mode,
:cert_store, :client_cert, :client_key, :certificate, :private_key, :verify_depth,
:version, :min_version, :max_version)

# @return [Boolean] true if should verify
def verify?
verify != false
end

# @return [Boolean] true if should not verify
def disable?
!verify?
end
Expand Down

0 comments on commit 89df1a1

Please sign in to comment.