Skip to content

Instantly share code, notes, and snippets.

Zike Zhao cqcn1991

Block or report user

Report or block cqcn1991

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mlsaito
mlsaito / ssl_version.md
Last active Jun 3, 2019
Specify SSL version (TLS 1.2) on HTTParty - a Ruby client library
View ssl_version.md

Implementation

Some vendors require you to call their API via TLS 1.2 and I don't see that much documentation on how to do this.

2 ways to make an HTTP request using HTTParty:

  1. Directly calling Class method.
# Notice the `ssl_version` option, to specify ssl version of the HTTP request
response = HTTParty.get('http://api.stackexchange.com/2.2/questions?site=stackoverflow', ssl_version: :TLSv1_2)
You can’t perform that action at this time.