Giter Club home page Giter Club logo

openssl-win-root's Introduction

OpenSSL::Win::Root

Build status Gem Version

Fetch Root CA certificates from Windows system store.

Abstract

Default installation of Ruby on Microsoft Windows provides no root certificates at all. Secure connections are simply impossible.

Recommended fix is to load http://curl.haxx.se/ca/cacert.pem and set SSL_CERT_FILE environment variable.

But Windows has its own certificate store. This gem just access it, fetch trusted root certificates and feed them to Ruby's OpenSSL.

So, if you installed some certificates or your company certificate is installed by Group Policy, these certificates will be available to your Ruby program. In addition, no network access is required.

Under other OSes this gem does nothing.

Installation

Add this line to your application's Gemfile:

  gem 'openssl-win-root' if Gem.win_platform?

And then execute:

  $ bundle

Or install it yourself as:

  $ gem install openssl-win-root

Usage

Just require 'openssl/win/root'

If your project uses Bundler.require (eg. Ruby on Rails) then just do nothing!

To test whether SSL works (or not):

require 'net/http'
Net::HTTP.get(URI 'https://ya.ru').length

You can use fetched certificates in non-Ruby projects by setting environment variable SSL_CERT_DIR to result of OpenSSL::Win::Root.path or via -CApath argument of openssl command.

See also

Credits

openssl-win-root's People

Contributors

ukoloff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

largo

openssl-win-root's Issues

Installation failed on ruby 2.2.0

Installation failed on ruby 2.2.0:

Building native extensions.  This could take a while...
ERROR:  Error installing openssl-win-root:
        ERROR: Failed to build gem native extension.

    C:/Ruby22-x64/bin/ruby.exe mkrf_conf.rb

C:/Ruby22-x64/bin/ruby.exe -rubygems C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-10.4.2/bin/rake RUBYARCHDIR=C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/openssl-win-root-1.0.0 RUBYLIBDIR=C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/openssl-win-root-1.0.0
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/openssl-win-root-1.0.0/lib/openssl/win/root.rb:55: warning: circular argument reference - path
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/openssl-win-root-1.0.0/lib/openssl/win/root.rb:64:in `join': no implicit conversion of nil into String (TypeError)
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/openssl-win-root-1.0.0/lib/openssl/win/root.rb:64:in `block in save'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/openssl-win-root-1.0.0/lib/openssl/win/root.rb:37:in `each'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/openssl-win-root-1.0.0/lib/openssl/win/root.rb:58:in `save'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/openssl-win-root-1.0.0/lib/openssl/win/root.rb:85:in `block in go!'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.