-
-
Save daya/71a589f9b83f9ff57608 to your computer and use it in GitHub Desktop.
testing_openssl.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git repo https://github.com/Shopify/active_merchant.git | |
export PATH=/var/vcap/packages/ruby/bin:$PATH:/var/vcap/packages/buildpacks/bin/: | |
echo "Ruby Version ---> $(ruby -v)" | |
cat << EOS > testing_openssl.rb | |
require 'net/http' | |
require 'uri' | |
uri = URI('https://www.google.com/') | |
Net::HTTP.start(uri.host, uri.port, | |
:use_ssl => uri.scheme == 'https') do |http| | |
request = Net::HTTP::Get.new uri | |
puts "port #{uri.port} host #{uri.host} before use_ssl? #{http.use_ssl?}" | |
response = http.request request # Net::HTTPResponse object | |
end | |
uri = URI.parse("https://www.google.com") | |
req = Net::HTTP::Get.new("/") | |
http = Net::HTTP.new(uri.host,uri.port) | |
puts "port #{uri.port} host #{uri.host} before use_ssl? #{http.use_ssl?}" | |
http.use_ssl=true | |
puts "after #{http.use_ssl?}" | |
resp = http.request(req) | |
puts resp.code | |
puts "OpenSSL::OPENSSL_VERSION = #{OpenSSL::OPENSSL_VERSION} #{defined?(OpenSSL::SSL)} OpenSSL::SSL #{OpenSSL::SSL} " | |
EOS | |
ruby testing_openssl.rb | |
echo "sourcing .... cf_buildpack" | |
. cf_buildpack | |
echo "----> installing gem bundle" | |
#bundle install --jobs=3 --retry=3 | |
echo "----> installed gem bundle running tests" | |
bundle exec rake test:units | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment