Add OpenSSL version check for X509_check_host

This commit is contained in:
Ian Craggs 2018-03-03 12:06:05 +00:00
parent 18010d4438
commit 5446bdca1c
2 changed files with 2 additions and 3 deletions

View File

@ -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;

View File

@ -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