changeset 2b87230489a2 in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=2b87230489a2
description: create certs path if it does not exist

diffstat:

 src/common/check_paths.py |  9 +++++++++
 src/common/jingle_xtls.py |  1 -
 2 files changed, 9 insertions(+), 1 deletions(-)

diffs (44 lines):

diff -r 2800e494c368 -r 2b87230489a2 src/common/check_paths.py
--- a/src/common/check_paths.py Sun Aug 08 21:25:29 2010 +0800
+++ b/src/common/check_paths.py Sun Aug 08 21:55:32 2010 +0800
@@ -29,6 +29,7 @@
 
 from common import gajim
 import logger
+from common import jingle_xtls
 
 # DO NOT MOVE ABOVE OF import gajim
 import sqlite3 as sqlite
@@ -267,6 +268,7 @@
     MY_DATA = configpaths.gajimpaths['MY_DATA']
     MY_CONFIG = configpaths.gajimpaths['MY_CONFIG']
     MY_CACHE = configpaths.gajimpaths['MY_CACHE']
+    XTLS_CERTS = os.path.expanduser('~/certs/')
 
     if not os.path.exists(MY_DATA):
         create_path(MY_DATA)
@@ -332,6 +334,13 @@
         print _('%s is a directory but should be a file') % CACHE_DB_PATH
         print _('Gajim will now exit')
         sys.exit()
+        
+    if not os.path.exists(XTLS_CERTS):
+        create_path(XTLS_CERTS)
+    if not (os.path.exists(os.path.join(XTLS_CERTS, 
jingle_xtls.SELF_SIGNED_CERTIFICATE + '.cert')) and
+                           os.path.exist(os.path.join(XTLS_CERTS, 
jingle_xtls.SELF_SIGNED_CERTIFICATE + '.pkey'))):
+        jingle_xtls.make_certs(XTLS_CERTS + 
jingle_xtls.SELF_SIGNED_CERTIFICATE, 'gajim')
+                               
 
 def create_path(directory):
     print _('creating %s directory') % directory
diff -r 2800e494c368 -r 2b87230489a2 src/common/jingle_xtls.py
--- a/src/common/jingle_xtls.py Sun Aug 08 21:25:29 2010 +0800
+++ b/src/common/jingle_xtls.py Sun Aug 08 21:55:32 2010 +0800
@@ -86,7 +86,6 @@
         
     ctx.use_privatekey_file (os.path.expanduser('~/certs/' + 
SELF_SIGNED_CERTIFICATE + '.pkey'))
     ctx.use_certificate_file(os.path.expanduser('~/certs/' + 
SELF_SIGNED_CERTIFICATE + '.cert'))
-    #    ctx.load_verify_locations(os.path.expanduser('~/certs/CA.cert'))
     store = ctx.get_cert_store()
     for f in os.listdir(os.path.expanduser('~/certs/')):
         load_cert_file(os.path.join(os.path.expanduser('~/certs'), f), store)
_______________________________________________
Commits mailing list
[email protected]
http://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to