Permalink
Browse files

Merge branch 'watusi_bosh_fixes' into rhodes

  • Loading branch information...
2 parents e547655 + adb9d49 commit 9c206c7b38e17e2df63605866aa9cd0f8696bb8b @jtara jtara committed Dec 20, 2011
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/xmpp4r/httpbinding/client.rb
View
7 lib/xmpp4r/httpbinding/client.rb
@@ -103,7 +103,7 @@ def connect(uri, host=nil, port=5222, opts={})
@use_ssl = @uri.kind_of? URI::HTTPS
@protocol_name = "HTTP#{'S' if @use_ssl}"
- @verify_mode = opts[:ssl_verify] ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE
+ @verify_mode = opts[:ssl_verify] ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE if @use_ssl
@http_connect = opts[:http_connect].to_i
@http_inactivity = opts[:http_inactivity].to_i
@@ -239,9 +239,10 @@ def post(body)
opts = {
:read_timeout => read_timeout, # wait this long for a response
- :use_ssl => @use_ssl, # Set SSL/no SSL
- :verify_mode => @verify_mode # Allow caller to defeat certificate verify
+ :use_ssl => @use_ssl # Set SSL/no SSL
}
+ opts[:verify_mode] = @verify_mode if @use_ssl # Allow caller to defeat certificate verify
+
Jabber::debuglog("#{@protocol_name} REQUEST (#{@pending_requests + 1}/#{@http_requests}) with timeout #{read_timeout}:\n#{request.body}")
response = @http.start(@uri.host, @uri.port, nil, nil, nil, nil, opts ) { |http|
http.request(request)

0 comments on commit 9c206c7

Please sign in to comment.