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

Proposed by Gary Lasker on 2012-01-19
Status: Merged
Merged at revision: 2488
Proposed branch: lp:~gary-lasker/software-center/staging-certs-2-for-5.0
Merge into: lp:software-center/5.0
Diff against target: 48 lines (+12/-3)
2 files modified
run_local.sh (+1/-0)
softwarecenter/ui/gtk3/views/purchaseview.py (+11/-3)
To merge this branch: bzr merge lp:~gary-lasker/software-center/staging-certs-2-for-5.0
Reviewer Review Type Date Requested Status
software-store-developers 2012-01-19 Pending
Review via email: mp+89175@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).

This is a 5.0 port of the corresponding branch in precise:

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

Thanks!

To post a comment you must log in.
Michael Vogt (mvo) wrote :

On Thu, Jan 19, 2012 at 01:07:29AM -0000, Gary Lasker wrote:
> Gary Lasker has proposed merging lp:~gary-lasker/software-center/staging-certs-2-for-5.0 into lp:software-center/5.0.
>
> Requested reviews:
> software-store-developers (software-store-developers)
>
> For more details, see:
> https://code.launchpad.net/~gary-lasker/software-center/staging-certs-2-for-5.0/+merge/89175
>
> 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).
>
> This is a 5.0 port of the corresponding branch in precise:
>
> lp:~gary-lasker/software-center/staging-certs-2

Thanks, looking good! For the 5.0 version we will need a SRU bugreport
though, it can be pretty trivial (like just ensuring that there are no
regressions).

Cheers,
 Michael

> Thanks!
> --
> https://code.launchpad.net/~gary-lasker/software-center/staging-certs-2-for-5.0/+merge/89175
> Your team software-store-developers is requested to review the proposed merge of lp:~gary-lasker/software-center/staging-certs-2-for-5.0 into lp:software-center/5.0.

> === modified file 'run_local.sh'
> --- run_local.sh 2011-08-19 11:54:50 +0000
> +++ run_local.sh 2012-01-19 01:06:43 +0000
> @@ -2,6 +2,7 @@
>
> export SOFTWARE_CENTER_REVIEWS_HOST="http://127.0.0.1:8000/reviews/api/1.0"
> export SOFTWARE_CENTER_FORCE_NON_SSL=1
> +export SOFTWARE_CENTER_FORCE_DISABLE_CERTS_CHECK=1
>
> # sso
> export USSOC_SERVICE_URL="https://login.staging.ubuntu.com/api/1.0"
>
> === modified file 'softwarecenter/ui/gtk3/views/purchaseview.py'
> --- softwarecenter/ui/gtk3/views/purchaseview.py 2011-11-24 09:51:29 +0000
> +++ softwarecenter/ui/gtk3/views/purchaseview.py 2012-01-19 01:06:43 +0000
> @@ -20,14 +20,12 @@
> from gi.repository import GObject
> from gi.repository import Gtk
> from gi.repository import Gdk
> +from gi.repository import WebKit as webkit
> import logging
> import os
> import json
> import sys
> import urllib
> -from gi.repository import WebKit as webkit
> -session = webkit.get_default_session()
> -session.set_property("ssl-ca-file", "/etc/ssl/certs/ca-certificates.crt")
>
> from gettext import gettext as _
>
> @@ -36,6 +34,16 @@
>
> LOG = logging.getLogger(__name__)
>
> +# enable certificates validation in webkit views unless specified otherwise
> +if not "SOFTWARE_CENTER_FORCE_DISABLE_CERTS_CHECK" in os.environ:
> + session = webkit.get_default_session()
> + session.set_property("ssl-ca-file", "/etc/ssl/certs/ca-certificates.crt")
> +else:
> + # WARN the user!! Do not remove this
> + LOG.warning("SOFTWARE_CENTER_FORCE_DISABLE_CERTS_CHECK " +
> + "has been specified, all purchase transactions " +
> + "are now INSECURE and UNENCRYPTED!!")
> +
> class LocaleAwareWebView(webkit.WebView):
>
> def __init__(self):
>

Gary Lasker (gary-lasker) wrote :

Ah yes, a bug report! Done (bug 918746), thanks mvo!

Michael Vogt (mvo) wrote :

On Thu, Jan 19, 2012 at 03:51:13PM -0000, Gary Lasker wrote:
> Ah yes, a bug report! Done (bug 918746), thanks mvo!

And you updated 5.0 already. Thanks!

Cheers,
 Michael

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'run_local.sh'
2--- run_local.sh 2011-08-19 11:54:50 +0000
3+++ run_local.sh 2012-01-19 01:06:43 +0000
4@@ -2,6 +2,7 @@
5
6 export SOFTWARE_CENTER_REVIEWS_HOST="http://127.0.0.1:8000/reviews/api/1.0"
7 export SOFTWARE_CENTER_FORCE_NON_SSL=1
8+export SOFTWARE_CENTER_FORCE_DISABLE_CERTS_CHECK=1
9
10 # sso
11 export USSOC_SERVICE_URL="https://login.staging.ubuntu.com/api/1.0"
12
13=== modified file 'softwarecenter/ui/gtk3/views/purchaseview.py'
14--- softwarecenter/ui/gtk3/views/purchaseview.py 2011-11-24 09:51:29 +0000
15+++ softwarecenter/ui/gtk3/views/purchaseview.py 2012-01-19 01:06:43 +0000
16@@ -20,14 +20,12 @@
17 from gi.repository import GObject
18 from gi.repository import Gtk
19 from gi.repository import Gdk
20+from gi.repository import WebKit as webkit
21 import logging
22 import os
23 import json
24 import sys
25 import urllib
26-from gi.repository import WebKit as webkit
27-session = webkit.get_default_session()
28-session.set_property("ssl-ca-file", "/etc/ssl/certs/ca-certificates.crt")
29
30 from gettext import gettext as _
31
32@@ -36,6 +34,16 @@
33
34 LOG = logging.getLogger(__name__)
35
36+# enable certificates validation in webkit views unless specified otherwise
37+if not "SOFTWARE_CENTER_FORCE_DISABLE_CERTS_CHECK" in os.environ:
38+ session = webkit.get_default_session()
39+ session.set_property("ssl-ca-file", "/etc/ssl/certs/ca-certificates.crt")
40+else:
41+ # WARN the user!! Do not remove this
42+ LOG.warning("SOFTWARE_CENTER_FORCE_DISABLE_CERTS_CHECK " +
43+ "has been specified, all purchase transactions " +
44+ "are now INSECURE and UNENCRYPTED!!")
45+
46 class LocaleAwareWebView(webkit.WebView):
47
48 def __init__(self):

Subscribers

People subscribed via source and target branches