Skip to content

Commit

Permalink
fix ssl issue and run without proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
nvbn committed Oct 8, 2012
1 parent 8065bcd commit 00e2d04
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions thrift/transport/THttpClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@
#

import httplib
import httpslib
import os
import socket
import sys
import urllib
import urlparse
import warnings

from thrift.transport import httpslib # fix ssl issue
from cStringIO import StringIO

from TTransport import *
Expand Down Expand Up @@ -78,14 +77,15 @@ def __init__(self, uri_or_host, port=None, path=None, http_proxy=None):
self.__custom_headers = None

def open(self):
http_proxy = getattr(self, 'http_proxy', None)
if self.scheme == 'http':
if self.http_proxy is not None:
if http_proxy is not None:
self.__http = httplib.HTTP(self.http_proxy.hostname,
self.http_proxy.port)
else:
self.__http = httplib.HTTP(self.host, self.port)
else:
if self.http_proxy is not None:
if http_proxy is not None:
self.__http = httpslib.HTTPS(self.http_proxy.hostname,
self.http_proxy.port)
self.__http._conn.set_tunnel(self.host, self.port)
Expand Down

0 comments on commit 00e2d04

Please sign in to comment.