Skip to content

Commit

Permalink
disable ssl verify
Browse files Browse the repository at this point in the history
  • Loading branch information
chebyte committed Oct 3, 2011
1 parent d05fa8b commit 032f280
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/youtube_it/request/video_upload.rb
Expand Up @@ -342,7 +342,7 @@ def generate_uniq_filename_from(data)

def auth_token
@auth_token ||= begin
http = Faraday.new("https://www.google.com")
http = Faraday.new("https://www.google.com", :ssl => {:verify => false})
body = "Email=#{YouTubeIt.esc @user}&Passwd=#{YouTubeIt.esc @password}&service=youtube&source=#{YouTubeIt.esc @client_id}"
response = http.post("/youtube/accounts/ClientLogin", body, "Content-Type" => "application/x-www-form-urlencoded")
raise ::AuthenticationError.new(response.body[/Error=(.+)/,1], response.status.to_i) if response.status.to_i != 200
Expand Down Expand Up @@ -420,11 +420,12 @@ def playlist_entry_id_from_playlist(string)
end

def yt_session(url = nil)
Faraday.new(:url => url ? url : base_url) do |builder|
Faraday.new(:url => (url ? url : base_url), :ssl => {:verify => false}) do |builder|
builder.use Faraday::Request::OAuth, @config_token if @config_token
builder.use Faraday::Request::AuthHeader, authorization_headers
builder.use Faraday::Response::YouTubeIt
builder.adapter Faraday.default_adapter
builder.adapter Faraday.default_adapter

end
end
end
Expand Down

0 comments on commit 032f280

Please sign in to comment.