REPP API changes

This commit is contained in:
Martin Lensment 2015-03-27 18:31:24 +02:00
parent 822b325bc0
commit ccd34ed4a9
5 changed files with 62 additions and 12 deletions

View file

@ -8,10 +8,10 @@ module Repp
end
before do
next if Rails.env.test?
next if Rails.env.test? || Rails.env.development?
message = 'Certificate mismatch! Cert common name should be:'
request_name = env['HTTP_SSL_CLIENT_S_DN_CN']
if request.ip == ENV['webclient_ip']
webclient_cert_name = ENV['webclient_cert_common_name'] || 'webclient'
error! "Webclient #{message} #{webclient_cert_name}", 401 if webclient_cert_name != request_name