@@ -109,65 +109,33 @@ def __init__(self,
109
109
if service_port is None :
110
110
service_port = bitcoin .params .RPC_PORT
111
111
conf ['rpcport' ] = int (conf .get ('rpcport' , service_port ))
112
- conf ['rpcssl' ] = conf .get ('rpcssl' , '0' )
113
112
conf ['rpchost' ] = conf .get ('rpcconnect' , 'localhost' )
114
113
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
-
138
114
if 'rpcpassword' not in conf :
139
115
raise ValueError ('The value of rpcpassword not specified in the configuration file: %s' % btc_conf_file )
140
116
141
117
service_url = ('%s://%s:%s@%s:%d' %
142
- ('https' if conf [ 'rpcssl' ] else ' http' ,
118
+ ('http' ,
143
119
conf ['rpcuser' ], conf ['rpcpassword' ],
144
120
conf ['rpchost' ], conf ['rpcport' ]))
145
121
146
122
self .__service_url = service_url
147
123
self .__url = urlparse .urlparse (service_url )
148
124
149
- if self .__url .scheme not in ('https' , ' http' ):
125
+ if self .__url .scheme not in ('http' , ):
150
126
raise ValueError ('Unsupported URL scheme %r' % self .__url .scheme )
151
127
152
128
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
157
130
else :
158
131
port = self .__url .port
159
132
self .__id_count = 0
160
133
authpair = "%s:%s" % (self .__url .username , self .__url .password )
161
134
authpair = authpair .encode ('utf8' )
162
135
self .__auth_header = b"Basic " + base64 .b64encode (authpair )
163
136
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 )
171
139
172
140
173
141
def _call (self , service_name , * args ):
0 commit comments