hector.aco...@cloudera.com has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/12420 )

Change subject: Add support for compiling using OpenSSL 1.1
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/12420/1/be/src/util/openssl-util.cc
File be/src/util/openssl-util.cc:

http://gerrit.cloudera.org:8080/#/c/12420/1/be/src/util/openssl-util.cc@76
PS1, Line 76: #else
            :   return TLS1_2_VERSION;
            : #endif
            : }
> May be replacing it with TLS_method() instead
I'm not sure I follow.

TLS_method() and friends are only available on OpenSSL 1.1+
https://www.openssl.org/docs/man1.0.2/man3/SSLv23_method.html
(1.0.2 doesn't list this function)

SSLv23_method() is available in OpenSSL 1.0 and 1.1.

We can't use TLS_method because it's not available in OpenSSL 1.0.
When compiling against openssl 1.1, we can't try to access the version member 
because the object is now opaque.

In short:
Using TLS_method breaks platforms with:
hacosta.cc:5:21: error: 'TLS_method' was not declared in this scope
   return TLS_method()->version;

Using SSLv23_method breaks openssl 1.1 with:
hacosta.cc:5:25: error: invalid use of incomplete type 'const SSL_METHOD {aka 
const struct ssl_method_st}'

Compiling and running this snippet:
```
(cdh) ?  cdh git:(hacosta-ubuntu) ? cat hacosta.cc
#include <openssl/ssl.h>
#include <stdio.h>

int MaxSupportedTlsVersion() {
#if OPENSSL_VERSION_NUMBER < 0x10100000L
    return SSLv23_method()->version;
#else
      return TLS1_2_VERSION;
#endif
}

int main() {
  printf("%d\n", MaxSupportedTlsVersion());
}
```

Behaves fine in these platforms:
(cdh) ?  cdh git:(hacosta-ubuntu) ? ./run2.sh
impala-toolchain-redhat6
771
impala-toolchain-redhat7
771
impala-toolchain-debian8
771
impala-toolchain-ubuntu1404
771
impala-toolchain-ubuntu1804
771



--
To view, visit http://gerrit.cloudera.org:8080/12420
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iaccf1b2dedf0d957a2665df8f9afca4139754264
Gerrit-Change-Number: 12420
Gerrit-PatchSet: 1
Gerrit-Owner: hector.aco...@cloudera.com <hector.aco...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Michael Ho <k...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com>
Gerrit-Reviewer: hector.aco...@cloudera.com <hector.aco...@cloudera.com>
Gerrit-Comment-Date: Tue, 12 Feb 2019 01:27:08 +0000
Gerrit-HasComments: Yes

Reply via email to