Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
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
32 changes: 26 additions & 6 deletions install-dev-dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
#!/bin/bash -ex
#!/bin/bash
# Install packages that are necessary and/or useful to build and debug
# HTTPS Everywhere
set -o errexit -o xtrace
set -o errexit

if [ "$1" != "--no-prompt" ]; then
echo
echo "Warning: Installing the development dependencies for HTTPS Everywhere"
echo "may alter your system, installing requirements both within the package"
echo "management system and also external binaries."
echo
echo -n "Are you sure you want to continue? [Y/n]: "
read CONTINUE
CONTINUE=`echo $CONTINUE | xargs | head -c 1 | awk '{print tolower($0)}'`
if [ "$CONTINUE" != "y" ]; then
exit
fi
echo
fi

if [ $UID != 0 ]; then
SUDO_SHIM=sudo
fi

if type apt-get >/dev/null ; then
$SUDO_SHIM apt-get update
$SUDO_SHIM apt-get install -y lsb-release
BROWSERS="firefox chromium-browser"
CHROMEDRIVER="chromium-chromedriver"
if [[ "$(lsb_release -is)" == "Debian" ]]; then
Expand All @@ -18,7 +35,7 @@ if type apt-get >/dev/null ; then
CHROMEDRIVER="chromedriver"
fi
# In Debian, `python-` is assumed to be python 2.7, no need to specify - dkg
$SUDO_SHIM apt-get install libxml2-dev libxml2-utils libxslt1-dev \
$SUDO_SHIM apt-get install -y libxml2-dev libxml2-utils libxslt1-dev \
python-dev $BROWSERS zip sqlite3 python-pip libcurl4-openssl-dev xvfb \
libssl-dev git curl $CHROMEDRIVER
if ! type geckodriver >/dev/null; then
Expand All @@ -29,16 +46,19 @@ if type apt-get >/dev/null ; then
$SUDO_SHIM chown root /usr/bin/geckodriver
$SUDO_SHIM chmod 755 /usr/bin/geckodriver
fi
if [ ! -f /usr/lib/chromium/chromedriver ] && [ -f `which chromedriver` ]; then
ln -s `which chromedriver` /usr/lib/chromium/chromedriver
fi
elif type brew >/dev/null ; then
brew list python &>/dev/null || brew install python
brew install libxml2 gnu-sed chromedriver
if ! echo $PATH | grep -ql /usr/local/bin ; then
echo '/usr/local/bin not found in $PATH, please add it.'
fi
elif type dnf >/dev/null ; then
$SUDO_SHIM dnf install firefox gcc git libcurl-devel libxml2-devel \
$SUDO_SHIM dnf install -y firefox gcc git libcurl-devel libxml2-devel \
libxslt-devel python-devel redhat-rpm-config xorg-x11-server-Xvfb which \
findutils procps openssl chromium GConf2
findutils procps openssl openssl-devel chromium GConf2 rsync
if ! type chromedriver >/dev/null; then
if [ "`uname -m`" == "x86_64" ]; then
ARCH=64
Expand All @@ -65,7 +85,7 @@ elif type dnf >/dev/null ; then
if [ ! -f /var/lib/dbus/machine-id ]; then
$SUDO_SHIM sh -c 'dbus-uuidgen > /var/lib/dbus/machine-id'
fi
export PYCURL_SSL_LIBRARY=nss

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nss used to be the default fedora libcurl library, no longer

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, also consider removing the NSS cipherlist at

# NSS cipher list from https://github.com/EFForg/https-everywhere/issues/5628#issuecomment-236050924
_DEFAULT_CIPHERLIST_NSS = "rsa_3des_sha,rsa_des_sha,rsa_null_md5,rsa_null_sha,rsa_rc2_40_md5,rsa_rc4_128_md5,rsa_rc4_128_sha,rsa_rc4_40_md5,fips_des_sha,fips_3des_sha,rsa_des_56_sha,rsa_rc4_56_sha,rsa_aes_128_sha,rsa_aes_256_sha,rsa_aes_128_gcm_sha_256,dhe_rsa_aes_128_gcm_sha_256,ecdh_ecdsa_null_sha,ecdh_ecdsa_rc4_128_sha,ecdh_ecdsa_3des_sha,ecdh_ecdsa_aes_128_sha,ecdh_ecdsa_aes_256_sha,ecdhe_ecdsa_null_sha,ecdhe_ecdsa_rc4_128_sha,ecdhe_ecdsa_3des_sha,ecdhe_ecdsa_aes_128_sha,ecdhe_ecdsa_aes_256_sha,ecdh_rsa_null_sha,ecdh_rsa_128_sha,ecdh_rsa_3des_sha,ecdh_rsa_aes_128_sha,ecdh_rsa_aes_256_sha,echde_rsa_null,ecdhe_rsa_rc4_128_sha,ecdhe_rsa_3des_sha,ecdhe_rsa_aes_128_sha,ecdhe_rsa_aes_256_sha,ecdhe_ecdsa_aes_128_gcm_sha_256,ecdhe_rsa_aes_128_gcm_sha_256"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should update the OpenSSL ciphers as well, since they are currently pinned at those offered by Firefox 51.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a task for another day, though.

@Hainish Hainish Nov 21, 2017 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also ensure that the macOS development environment doesn't use NSS. Though I'm unsure how well macOS is supported in general, and I was unable to test this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added that _DEFAULT_CIPHERLIST_NSS line specifically when I was working on Fedora last year. It seems unlikely that macOS needs it. I understand wanting to test it, though.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this also doesn't solve all the problems with Fedora, I'm still running into errors when I try to run the test in docker. This should at least get Fedora systems to a point where the dependencies are installed, though.

export PYCURL_SSL_LIBRARY=openssl
fi

# Get the addon SDK submodule and rule checker
Expand Down
7 changes: 1 addition & 6 deletions test/rules/src/https_everywhere_checker/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,8 @@ def getCAPath(self, platform):
class FetchOptions(object):
"""HTTP fetcher options like timeouts."""

# NSS cipher list from https://github.com/EFForg/https-everywhere/issues/5628#issuecomment-236050924
_DEFAULT_CIPHERLIST_NSS = "rsa_3des_sha,rsa_des_sha,rsa_null_md5,rsa_null_sha,rsa_rc2_40_md5,rsa_rc4_128_md5,rsa_rc4_128_sha,rsa_rc4_40_md5,fips_des_sha,fips_3des_sha,rsa_des_56_sha,rsa_rc4_56_sha,rsa_aes_128_sha,rsa_aes_256_sha,rsa_aes_128_gcm_sha_256,dhe_rsa_aes_128_gcm_sha_256,ecdh_ecdsa_null_sha,ecdh_ecdsa_rc4_128_sha,ecdh_ecdsa_3des_sha,ecdh_ecdsa_aes_128_sha,ecdh_ecdsa_aes_256_sha,ecdhe_ecdsa_null_sha,ecdhe_ecdsa_rc4_128_sha,ecdhe_ecdsa_3des_sha,ecdhe_ecdsa_aes_128_sha,ecdhe_ecdsa_aes_256_sha,ecdh_rsa_null_sha,ecdh_rsa_128_sha,ecdh_rsa_3des_sha,ecdh_rsa_aes_128_sha,ecdh_rsa_aes_256_sha,echde_rsa_null,ecdhe_rsa_rc4_128_sha,ecdhe_rsa_3des_sha,ecdhe_rsa_aes_128_sha,ecdhe_rsa_aes_256_sha,ecdhe_ecdsa_aes_128_gcm_sha_256,ecdhe_rsa_aes_128_gcm_sha_256"

# The default list of cipher suites that ships with Firefox 51.0.1
_DEFAULT_CIPHERLIST_OTHER = "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:AES128-SHA:AES256-SHA:DES-CBC3-SHA"

_DEFAULT_CIPHERLIST = _DEFAULT_CIPHERLIST_NSS if re.search('NSS/\d+\.\d+', pycurl.version) else _DEFAULT_CIPHERLIST_OTHER
_DEFAULT_CIPHERLIST = "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:AES128-SHA:AES256-SHA:DES-CBC3-SHA"

def __init__(self, config):
"""Parse options from [http] section
Expand Down