rename ssl config variables

This commit is contained in:
ThomasV 2015-04-30 17:33:29 +02:00
parent 1b6abf6e02
commit c35cdf1fd8
2 changed files with 7 additions and 7 deletions

View File

@ -737,9 +737,9 @@ class ElectrumWindow(QMainWindow):
message = self.wallet.labels.get(addr, '')
script = Transaction.pay_script('address', addr).decode('hex')
outputs = [(script, amount)]
cert_path = self.config.get('cert_path')
chain_path = self.config.get('chain_path')
return make_payment_request(outputs, message, time, time + expiration, cert_path, chain_path)
key_path = self.config.get('ssl_key_path')
cert_path = self.config.get('ssl_cert_path')
return make_payment_request(outputs, message, time, time + expiration, key_path, cert_path)
def export_payment_request(self, addr):
pr = self.make_payment_request(addr)

View File

@ -258,7 +258,7 @@ class PaymentRequest:
def make_payment_request(outputs, memo, time, expires, cert_path, chain_path):
def make_payment_request(outputs, memo, time, expires, key_path, cert_path):
pd = pb2.PaymentDetails()
for script, amount in outputs:
pd.outputs.add(amount=amount, script=script)
@ -271,11 +271,11 @@ def make_payment_request(outputs, memo, time, expires, cert_path, chain_path):
pr = pb2.PaymentRequest()
pr.serialized_payment_details = pd.SerializeToString()
pr.signature = ''
if cert_path and chain_path:
if key_path and cert_path:
import tlslite
with open(cert_path, 'r') as f:
with open(key_path, 'r') as f:
rsakey = tlslite.utils.python_rsakey.Python_RSAKey.parsePEM(f.read())
with open(chain_path, 'r') as f:
with open(cert_path, 'r') as f:
chain = tlslite.X509CertChain()
chain.parsePemList(f.read())
certificates = pb2.X509Certificates()