~paolorotolo/software-center/fix-for-963309

« back to all changes in this revision

Viewing changes to software-center

  • Committer: Danny Tamez
  • Date: 2012-01-19 16:17:34 UTC
  • mfrom: (2682 trunk)
  • mto: This revision was merged to the branch mainline in revision 2683.
  • Revision ID: danny.tamez@canonical.com-20120119161734-8viwvv83ph9d4kfx
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
# Enable Xapian's CJK tokenizer (see LP: #745243)
46
46
os.environ['XAPIAN_CJK_NGRAM'] = '1'
47
47
 
 
48
LOG = logging.getLogger("softwarecenter")
 
49
 
48
50
if __name__ == "__main__":
49
51
 
50
52
    parser = OptionParser("usage: %prog [options] [package-name | apturl | deb-file]", 
124
126
    # on exit. However its IMPORTANT to set it as libsoup is *not* secure
125
127
    # by default (see bugzilla #666280 and #666276)
126
128
    from gi.repository import WebKit as webkit
127
 
    session = webkit.get_default_session()
128
 
    session.set_property("ssl-ca-file", "/etc/ssl/certs/ca-certificates.crt")
 
129
    # enable certificates validation in webkit views unless specified otherwise
 
130
    if not "SOFTWARE_CENTER_FORCE_DISABLE_CERTS_CHECK" in os.environ:
 
131
        session = webkit.get_default_session()
 
132
        session.set_property("ssl-ca-file", "/etc/ssl/certs/ca-certificates.crt")
 
133
    else:
 
134
        # WARN the user!! Do not remove this
 
135
        LOG.warning("SOFTWARE_CENTER_FORCE_DISABLE_CERTS_CHECK " +
 
136
                    "has been specified, all purchase transactions " + 
 
137
                    "are now INSECURE and UNENCRYPTED!!")
129
138
 
130
139
    # create the app
131
140
    from softwarecenter.ui.gtk3.app import SoftwareCenterAppGtk3