Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Fixes SSL certificate verification #49

Merged
merged 1 commit into from
Jan 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/webpack/rails/manifest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def load_dev_server_manifest
port = ::Rails.configuration.webpack.dev_server.manifest_port
http = Net::HTTP.new(host, port)
http.use_ssl = ::Rails.configuration.webpack.dev_server.https
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
http.verify_mode = ::Rails.configuration.webpack.dev_server.https_verify_peer ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE
http.get(dev_server_path).body
rescue => e
raise ManifestLoadError.new("Could not load manifest from webpack-dev-server at http://#{host}:#{port}#{dev_server_path} - is it running, and is stats-webpack-plugin loaded?", e)
Expand Down
4 changes: 3 additions & 1 deletion lib/webpack/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ class Railtie < ::Rails::Railtie
config.webpack.dev_server.manifest_host = 'localhost'
config.webpack.dev_server.manifest_port = 3808

config.webpack.dev_server.https = false # note - this will use OpenSSL::SSL::VERIFY_NONE
config.webpack.dev_server.https = false
# change below option to false if you don't care about security
config.webpack.dev_server.https_verify_peer = true
config.webpack.dev_server.binary = 'node_modules/.bin/webpack-dev-server'
config.webpack.dev_server.enabled = !::Rails.env.production?

Expand Down