2 Commits

3 changed files with 66 additions and 2 deletions

53
set-secure-default.patch Normal file
View File

@@ -0,0 +1,53 @@
From 74d662e1e00de05779c71717626bb7ec299bdf3c Mon Sep 17 00:00:00 2001
From: Strahinja Kustudic <strahinjak@nordeus.com>
Date: Tue, 1 Aug 2023 11:17:06 +0200
Subject: [PATCH] Set secure connection as default
Speedtest servers don't support HTTP connections anymore so I renamed
the `--secure` parameter to `--insecure` and set it to False by default.
---
speedtest.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/speedtest.py b/speedtest.py
index 186b52929..59540af66 100755
--- a/speedtest.py
+++ b/speedtest.py
@@ -946,7 +946,7 @@ class SpeedtestResults(object):
"""
def __init__(self, download=0, upload=0, ping=0, server=None, client=None,
- opener=None, secure=False):
+ opener=None, secure=True):
self.download = download
self.upload = upload
self.ping = ping
@@ -1087,7 +1087,7 @@ class Speedtest(object):
"""Class for performing standard speedtest.net testing operations"""
def __init__(self, config=None, source_address=None, timeout=10,
- secure=False, shutdown_event=None):
+ secure=True, shutdown_event=None):
self.config = {}
self._source_address = source_address
@@ -1770,8 +1770,8 @@ def parse_args():
parser.add_argument('--source', help='Source IP address to bind to')
parser.add_argument('--timeout', default=10, type=PARSER_TYPE_FLOAT,
help='HTTP timeout in seconds. Default 10')
- parser.add_argument('--secure', action='store_true',
- help='Use HTTPS instead of HTTP when communicating '
+ parser.add_argument('--insecure', action='store_true', default=False,
+ help='Use HTTP instead of HTTPS when communicating '
'with speedtest.net operated servers')
parser.add_argument('--no-pre-allocate', dest='pre_allocate',
action='store_const', default=True, const=False,
@@ -1885,7 +1885,7 @@ def shell():
speedtest = Speedtest(
source_address=args.source,
timeout=args.timeout,
- secure=args.secure
+ secure=not args.insecure
)
except (ConfigRetrievalError,) + HTTP_ERRORS:
printer('Cannot retrieve speedtest configuration', error=True)

View File

@@ -1,3 +1,12 @@
-------------------------------------------------------------------
Sun Aug 11 14:09:21 UTC 2024 - Bjørn Lie <bjorn.lie@gmail.com>
- Add set-secure-default.patch: Set secure connection as default.
Speedtest servers don't support HTTP connections anymore so I
renamed the `--secure` parameter to `--insecure` and set it to
False by default.
https://github.com/sivel/speedtest-cli/pull/800
-------------------------------------------------------------------
Wed Apr 3 14:49:35 UTC 2024 - Stefan Seyfried <seife+obs@b1-systems.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package speedtest-cli
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -25,6 +25,8 @@ License: Apache-2.0
Group: System/Benchmark
URL: https://github.com/sivel/speedtest-cli
Source0: https://github.com/sivel/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM set-secure-default.patch -- Set secure connection as default
Patch0: set-secure-default.patch
BuildRequires: python-rpm-macros
BuildRequires: python3-base
BuildRequires: python3-setuptools
@@ -35,7 +37,7 @@ Command line interface for testing internet bandwidth using
speedtest.net
%prep
%autosetup
%autosetup -p1
sed -i -e '/^#!\//, 1d' *.py
%build