Merge pull request #2629 from reaperhulk/travis-refactor

refactor travis custom openssl code to work with other versions
diff --git a/.travis.yml b/.travis.yml
index 4ded04d..e99d890 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -33,12 +33,6 @@
           env: TOXENV=py35 OPENSSL=0.9.8
         - python: pypy
           env: TOXENV=pypy OPENSSL=0.9.8
-          addons:
-              apt:
-                  sources:
-                      - lucid
-                  packages:
-                      - libssl-dev/lucid
         - python: 2.7
           env: TOXENV=docs
           addons:
@@ -51,43 +45,46 @@
           env: TOXENV=py3pep8
         - language: generic
           os: osx
-          osx_image: xcode7
+          # 7.1 is OS X 10.10.x
+          # see: https://docs.travis-ci.com/user/languages/objective-c/#Supported-OS-X-iOS-SDK-versions
+          osx_image: xcode7.1
           env: TOXENV=py26 CRYPTOGRAPHY_OSX_NO_LINK_FLAGS=1
         - language: generic
           os: osx
-          osx_image: xcode7
+          osx_image: xcode7.1
           env: TOXENV=py27 CRYPTOGRAPHY_OSX_NO_LINK_FLAGS=1
         - language: generic
           os: osx
-          osx_image: xcode7
+          osx_image: xcode7.1
           env: TOXENV=py33 CRYPTOGRAPHY_OSX_NO_LINK_FLAGS=1
         - language: generic
           os: osx
-          osx_image: xcode7
+          osx_image: xcode7.1
           env: TOXENV=py34 CRYPTOGRAPHY_OSX_NO_LINK_FLAGS=1
         - language: generic
           os: osx
-          osx_image: xcode7
+          osx_image: xcode7.1
           env: TOXENV=py35 CRYPTOGRAPHY_OSX_NO_LINK_FLAGS=1
         - language: generic
           os: osx
-          osx_image: xcode7
+          osx_image: xcode7.1
           env: TOXENV=pypy CRYPTOGRAPHY_OSX_NO_LINK_FLAGS=1
         - language: generic
           os: osx
-          osx_image: xcode7
+          osx_image: xcode7.1
           env: TOXENV=py27 CRYPTOGRAPHY_OSX_NO_LINK_FLAGS=0
         - language: generic
           os: osx
-          osx_image: osx10.11
+          # 7.2 is OS X 10.11.x
+          osx_image: xcode7.2
           env: TOXENV=py26 CRYPTOGRAPHY_OSX_NO_LINK_FLAGS=1
         - language: generic
           os: osx
-          osx_image: osx10.11
+          osx_image: xcode7.2
           env: TOXENV=py27 CRYPTOGRAPHY_OSX_NO_LINK_FLAGS=1
         - language: generic
           os: osx
-          osx_image: xcode7
+          osx_image: xcode7.2
           env: TOXENV=docs CRYPTOGRAPHY_OSX_NO_LINK_FLAGS=1
 
 install:
diff --git a/.travis/run.sh b/.travis/run.sh
index 9731e20a..5470c82 100755
--- a/.travis/run.sh
+++ b/.travis/run.sh
@@ -15,6 +15,9 @@
         export LDFLAGS="/usr/local/opt/openssl/lib/libssl.a /usr/local/opt/openssl/lib/libcrypto.a"
     else
         export LDFLAGS="-L/usr/local/opt/openssl/lib"
+        # on a dynamic build we only need to test against OpenSSL -- CC is not affected by
+        # dynamic vs static
+        export TOX_FLAGS="--backend=openssl"
     fi
     export CFLAGS="-I/usr/local/opt/openssl/include"
 else