changeset 8885c892dfc9 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=8885c892dfc9 description: Fix Jingle XTLS certificate creation.
diffstat:
src/common/jingle_xtls.py | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
diffs (18 lines):
diff -r a4a874736cfd -r 8885c892dfc9 src/common/jingle_xtls.py --- a/src/common/jingle_xtls.py Thu Feb 28 12:05:07 2013 +0400 +++ b/src/common/jingle_xtls.py Tue Mar 05 15:58:20 2013 +0100 @@ -236,10 +236,10 @@ key = createKeyPair(TYPE_RSA, 1024) req = createCertRequest(key, CN=CN) cert = createCertificate(req, req, key, 0, 0, 60*60*24*365*5) # five years - open(filepath + '.pkey', 'w').write(crypto.dump_privatekey( - crypto.FILETYPE_PEM, key)) - open(filepath + '.cert', 'w').write(crypto.dump_certificate( - crypto.FILETYPE_PEM, cert)) + with open(filepath + '.pkey', 'wb') as f: + f.write(crypto.dump_privatekey(crypto.FILETYPE_PEM, key)) + with open(filepath + '.cert', 'wb') as f: + f.write(crypto.dump_certificate(crypto.FILETYPE_PEM, cert))
if __name__ == '__main__':