| 42 | namespace impala { |
| 43 | |
| 44 | ThriftClientImpl::ThriftClientImpl(const std::string& ipaddress, int port, bool ssl, |
| 45 | bool disable_tls12) |
| 46 | : address_(MakeNetworkAddress(ipaddress, port)), ssl_(ssl), |
| 47 | disable_tls12_(disable_tls12) { |
| 48 | if (ssl_) { |
| 49 | SSLProtocol version; |
| 50 | init_status_ = |
| 51 | SSLProtoVersions::StringToProtocol(FLAGS_ssl_minimum_version, &version); |
| 52 | if (init_status_.ok() && !SSLProtoVersions::IsSupported(version)) { |
| 53 | string err = |
| 54 | Substitute("TLS ($0) version not supported (maximum supported version is $1)", |
| 55 | version, MaxSupportedTlsVersion()); |
| 56 | init_status_ = Status(err); |
| 57 | } |
| 58 | if (!init_status_.ok()) return; |
| 59 | ssl_factory_.reset(new ImpalaTlsSocketFactory(version)); |
| 60 | } |
| 61 | init_status_ = CreateSocket(); |
| 62 | } |
| 63 | |
| 64 | Status ThriftClientImpl::Open() { |
| 65 | RETURN_IF_ERROR(init_status_); |
nothing calls this directly
no test coverage detected