From 5446bdca1c026808f228289d30f26d63ce86ecd6 Mon Sep 17 00:00:00 2001 From: Ian Craggs Date: Sat, 3 Mar 2018 12:06:05 +0000 Subject: [PATCH] Add OpenSSL version check for X509_check_host --- src/SSLSocket.c | 2 ++ travis-install.sh | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/SSLSocket.c b/src/SSLSocket.c index 309f5b46..2f770e33 100644 --- a/src/SSLSocket.c +++ b/src/SSLSocket.c @@ -674,6 +674,7 @@ int SSLSocket_connect(SSL* ssl, int sock, char* hostname, int verify) if (error == SSL_ERROR_WANT_READ || error == SSL_ERROR_WANT_WRITE) rc = TCPSOCKET_INTERRUPTED; } +#if (OPENSSL_VERSION_NUMBER >= 0x010002000) /* 1.0.2 and later */ else if (verify == 1) { char* peername = NULL; @@ -694,6 +695,7 @@ int SSLSocket_connect(SSL* ssl, int sock, char* hostname, int verify) if (addr != hostname) free(addr); } +#endif FUNC_EXIT_RC(rc); return rc; diff --git a/travis-install.sh b/travis-install.sh index 5a9ceb86..0405da62 100755 --- a/travis-install.sh +++ b/travis-install.sh @@ -2,9 +2,6 @@ if [ "$TRAVIS_OS_NAME" == "linux" ]; then pwd - sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu/ trusty main universe" - sudo apt-get update -qq - sudo apt-get install -qq libssl-dev sudo service mosquitto stop # Stop any mosquitto instance which may be still running from previous runs killall mosquitto