1
0
Fork 0

Feature 3.5/enable tlsv13 (#9818)

* define TLS_V13 symbol only conditionally

* updated CHANGELOG
This commit is contained in:
Jan 2019-08-28 13:05:00 +02:00 committed by KVS85
parent 226373e200
commit 34957ee223
4 changed files with 30 additions and 10 deletions

View File

@ -1,6 +1,22 @@
v3.5.1 (XXXX-XX-XX)
-------------------
* Added support for TLS 1.3 for the arangod server and the client tools.
The default TLS protocol for the arangod server is still TLS 1.2 however, in order
to keep compatibility with previous versions of ArangoDB.
The arangod server and any of the client tools can be started with option
`--ssl.protocol 6` to make use of TLS 1.3.
To configure the TLS version for arangod instances started by the ArangoDB starter,
one can use the `--all.ssl.protocol=VALUE` startup option for the ArangoDB starter,
where VALUE is one of the following:
- 4 = TLSv1
- 5 = TLSv1.2
- 6 = TLSv1.3
* Fixed parsing of "NOT IN" in AQL, which previously didn't correctly parse
"NOT IN_RANGE(...)" because it checked if the "NOT" token was followed by
whitespace and then the two letters "IN".

View File

@ -242,18 +242,14 @@ void SslClientConnection::init(uint64_t sslProtocol) {
#endif
break;
case TLS_V13:
// TLS 1.3, only supported from OpenSSL 1.1.1 onwards
// openssl version number format is
// MNNFFPPS: major minor fix patch status
#if OPENSSL_VERSION_NUMBER >= 0x10101000L
case TLS_V13:
meth = TLS_client_method();
break;
#else
// no TLS 1.3 support
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_NOT_IMPLEMENTED,
"TLS 1.3 is not supported in this build");
#endif
case SSL_UNKNOWN:
@ -319,7 +315,9 @@ bool SslClientConnection::connectSocket() {
switch (SslProtocol(_sslProtocol)) {
case TLS_V1:
case TLS_V12:
#if OPENSSL_VERSION_NUMBER >= 0x10101000L
case TLS_V13:
#endif
default:
SSL_set_tlsext_host_name(_ssl, _endpoint->host().c_str());
}

View File

@ -67,17 +67,13 @@ asio_ns::ssl::context arangodb::sslContext(SslProtocol protocol, std::string con
meth = context::method::tlsv12_server;
break;
#if OPENSSL_VERSION_NUMBER >= 0x10101000L
case TLS_V13:
// TLS 1.3, only supported from OpenSSL 1.1.1 onwards
#if OPENSSL_VERSION_NUMBER >= 0x10101000L
// openssl version number format is
// MNNFFPPS: major minor fix patch status
meth = context::method::tlsv13_server;
break;
#else
// no TLS 1.3 support
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_NOT_IMPLEMENTED,
"TLS 1.3 is not supported in this build");
#endif
default:
@ -137,8 +133,10 @@ std::string arangodb::protocolName(SslProtocol protocol) {
case TLS_V12:
return "TLSv12";
#if OPENSSL_VERSION_NUMBER >= 0x10101000L
case TLS_V13:
return "TLSv13";
#endif
default:
return "unknown";
@ -163,9 +161,15 @@ std::unordered_set<uint64_t> arangodb::availableSslProtocols() {
}
std::string arangodb::availableSslProtocolsDescription() {
#if OPENSSL_VERSION_NUMBER >= 0x10101000L
return "ssl protocol (1 = SSLv2 (unsupported), 2 = SSLv2 or SSLv3 "
"(negotiated), 3 = SSLv3, 4 = "
"TLSv1, 5 = TLSv1.2, 6 = TLSv1.3)";
#else
return "ssl protocol (1 = SSLv2 (unsupported), 2 = SSLv2 or SSLv3 "
"(negotiated), 3 = SSLv3, 4 = "
"TLSv1, 5 = TLSv1.2)";
#endif
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -48,7 +48,9 @@ enum SslProtocol {
SSL_V3 = 3,
TLS_V1 = 4,
TLS_V12 = 5,
#if OPENSSL_VERSION_NUMBER >= 0x10101000L
TLS_V13 = 6,
#endif
SSL_LAST
};