Merge lp:~gary-lasker/software-center/staging-certs-2 into lp:software-center

Proposed by Gary Lasker
Status: Merged
Merged at revision: 2680
Proposed branch: lp:~gary-lasker/software-center/staging-certs-2
Merge into: lp:software-center
Diff against target: 77 lines (+12/-27)
4 files modified
run_fake_gtk3.sh (+0/-7)
run_local.sh (+1/-0)
run_local_gtk3.sh (+0/-18)
software-center (+11/-2)
To merge this branch: bzr merge lp:~gary-lasker/software-center/staging-certs-2
Reviewer Review Type Date Requested Status
software-store-developers Pending
Review via email: mp+89161@code.launchpad.net

Description of the change

This is a small branch that adds an environment variable, SOFTWARE_CENTER_FORCE_DISABLE_CERTS_CHECK, that disables certificates validation in webkit views (as used in the for-purchase views). This switch will allow testing against a server that does not have a valid certificate (e.g. the staging server currently).

When this environment variable is set, a somewhat alarming warning is displayed to the user in the log.

This branch also removes the two scripts run_fake_gtk3.sh and run_local.sh, as these are not used anymore.

Thanks!

To post a comment you must log in.
2682. By Gary Lasker

d'oh, remove this leftover

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed file 'run_fake_gtk3.sh'
--- run_fake_gtk3.sh 2011-08-15 11:55:13 +0000
+++ run_fake_gtk3.sh 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
1#!/bin/sh
2
3export SOFTWARE_CENTER_FAKE_REVIEW_API="1"
4
5# s-c
6export PYTHONPATH=$(pwd)
7./software-center-gtk3 $@
80
=== modified file 'run_local.sh'
--- run_local.sh 2011-08-19 11:54:50 +0000
+++ run_local.sh 2012-01-19 00:47:24 +0000
@@ -2,6 +2,7 @@
22
3export SOFTWARE_CENTER_REVIEWS_HOST="http://127.0.0.1:8000/reviews/api/1.0"3export SOFTWARE_CENTER_REVIEWS_HOST="http://127.0.0.1:8000/reviews/api/1.0"
4export SOFTWARE_CENTER_FORCE_NON_SSL=14export SOFTWARE_CENTER_FORCE_NON_SSL=1
5export SOFTWARE_CENTER_FORCE_DISABLE_CERTS_CHECK=1
56
6# sso7# sso
7export USSOC_SERVICE_URL="https://login.staging.ubuntu.com/api/1.0"8export USSOC_SERVICE_URL="https://login.staging.ubuntu.com/api/1.0"
89
=== removed file 'run_local_gtk3.sh'
--- run_local_gtk3.sh 2011-08-15 11:55:13 +0000
+++ run_local_gtk3.sh 1970-01-01 00:00:00 +0000
@@ -1,18 +0,0 @@
1#!/bin/sh
2
3export SOFTWARE_CENTER_REVIEWS_HOST="http://127.0.0.1:8000/reviews/api/1.0"
4export SOFTWARE_CENTER_FORCE_NON_SSL=1
5
6# sso
7export USSOC_SERVICE_URL="https://login.staging.ubuntu.com/api/1.0"
8pkill -f ubuntu-sso-login
9python /usr/lib/ubuntu-sso-client/ubuntu-sso-login &
10
11# s-c
12export PYTHONPATH=$(pwd)
13
14if [ ! -d "./build" ]; then
15 echo "Please run: 'python setup.py build' before $0"
16fi
17
18./software-center-gtk3 $@
190
=== modified file 'software-center'
--- software-center 2012-01-06 16:59:29 +0000
+++ software-center 2012-01-19 00:47:24 +0000
@@ -45,6 +45,8 @@
45# Enable Xapian's CJK tokenizer (see LP: #745243)45# Enable Xapian's CJK tokenizer (see LP: #745243)
46os.environ['XAPIAN_CJK_NGRAM'] = '1'46os.environ['XAPIAN_CJK_NGRAM'] = '1'
4747
48LOG = logging.getLogger("softwarecenter")
49
48if __name__ == "__main__":50if __name__ == "__main__":
4951
50 parser = OptionParser("usage: %prog [options] [package-name | apturl | deb-file]", 52 parser = OptionParser("usage: %prog [options] [package-name | apturl | deb-file]",
@@ -124,8 +126,15 @@
124 # on exit. However its IMPORTANT to set it as libsoup is *not* secure126 # on exit. However its IMPORTANT to set it as libsoup is *not* secure
125 # by default (see bugzilla #666280 and #666276)127 # by default (see bugzilla #666280 and #666276)
126 from gi.repository import WebKit as webkit128 from gi.repository import WebKit as webkit
127 session = webkit.get_default_session()129 # enable certificates validation in webkit views unless specified otherwise
128 session.set_property("ssl-ca-file", "/etc/ssl/certs/ca-certificates.crt")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!!")
129138
130 # create the app139 # create the app
131 from softwarecenter.ui.gtk3.app import SoftwareCenterAppGtk3140 from softwarecenter.ui.gtk3.app import SoftwareCenterAppGtk3

Subscribers

People subscribed via source and target branches