Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set secure connection as default #800

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions speedtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down