@@ -109,65 +109,33 @@ def __init__(self,
109109 if service_port is None :
110110 service_port = bitcoin .params .RPC_PORT
111111 conf ['rpcport' ] = int (conf .get ('rpcport' , service_port ))
112- conf ['rpcssl' ] = conf .get ('rpcssl' , '0' )
113112 conf ['rpchost' ] = conf .get ('rpcconnect' , 'localhost' )
114113
115- if conf ['rpcssl' ].lower () in ('0' , 'false' ):
116- conf ['rpcssl' ] = False
117- elif conf ['rpcssl' ].lower () in ('1' , 'true' ):
118- conf ['rpcssl' ] = True
119- else :
120- raise ValueError ('Unknown rpcssl value %r' % conf ['rpcssl' ])
121-
122- if conf ['rpcssl' ] and 'rpcsslcertificatechainfile' in conf and 'rpcsslprivatekeyfile' in conf :
123- self .__ssl_context = ssl .SSLContext (ssl .PROTOCOL_TLSv1_2 )
124- if os .path .exists (conf ['rpcsslcertificatechainfile' ]):
125- certificate = conf ['rpcsslcertificatechainfile' ]
126- elif os .path .exists (os .path .join (os .path .dirname (btc_conf_file ), conf ['rpcsslcertificatechainfile' ])):
127- certificate = os .path .join (os .path .dirname (btc_conf_file ), conf ['rpcsslcertificatechainfile' ])
128- else :
129- raise ValueError ('The value of rpcsslcertificatechainfile is not correctly specified in the configuration file: %s' % btc_conf_file )
130- if os .path .exists (conf ['rpcsslprivatekeyfile' ]):
131- private_key = conf ['rpcsslprivatekeyfile' ]
132- elif os .path .exists (os .path .join (os .path .dirname (btc_conf_file ), conf ['rpcsslprivatekeyfile' ])):
133- private_key = os .path .join (os .path .dirname (btc_conf_file ), conf ['rpcsslprivatekeyfile' ])
134- else :
135- raise ValueError ('The value of rpcsslprivatekeyfile is not correctly specified in the configuration file: %s' % btc_conf_file )
136- self .__ssl_context .load_cert_chain (certificate , private_key )
137-
138114 if 'rpcpassword' not in conf :
139115 raise ValueError ('The value of rpcpassword not specified in the configuration file: %s' % btc_conf_file )
140116
141117 service_url = ('%s://%s:%s@%s:%d' %
142- ('https' if conf [ 'rpcssl' ] else ' http' ,
118+ ('http' ,
143119 conf ['rpcuser' ], conf ['rpcpassword' ],
144120 conf ['rpchost' ], conf ['rpcport' ]))
145121
146122 self .__service_url = service_url
147123 self .__url = urlparse .urlparse (service_url )
148124
149- if self .__url .scheme not in ('https' , ' http' ):
125+ if self .__url .scheme not in ('http' , ):
150126 raise ValueError ('Unsupported URL scheme %r' % self .__url .scheme )
151127
152128 if self .__url .port is None :
153- if self .__url .scheme == 'https' :
154- port = httplib .HTTPS_PORT
155- else :
156- port = httplib .HTTP_PORT
129+ port = httplib .HTTP_PORT
157130 else :
158131 port = self .__url .port
159132 self .__id_count = 0
160133 authpair = "%s:%s" % (self .__url .username , self .__url .password )
161134 authpair = authpair .encode ('utf8' )
162135 self .__auth_header = b"Basic " + base64 .b64encode (authpair )
163136
164- if self .__url .scheme == 'https' :
165- self .__conn = httplib .HTTPSConnection (self .__url .hostname , port = port ,
166- context = self .__ssl_context ,
167- timeout = timeout )
168- else :
169- self .__conn = httplib .HTTPConnection (self .__url .hostname , port = port ,
170- timeout = timeout )
137+ self .__conn = httplib .HTTPConnection (self .__url .hostname , port = port ,
138+ timeout = timeout )
171139
172140
173141 def _call (self , service_name , * args ):
0 commit comments