Skip to content

Commit 600e631

Browse files
authored
Merge pull request #9945 from Icinga/2139backport
Disable TLS renegotiation, bump Windows deps and fix Icinga DB crashes
2 parents 5acf3fb + b2d975f commit 600e631

File tree

6 files changed

+39
-23
lines changed

6 files changed

+39
-23
lines changed

doc/21-development.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -477,18 +477,18 @@ File Type: EXECUTABLE IMAGE
477477
478478
Image has the following dependencies:
479479
480-
boost_coroutine-vc142-mt-gd-x64-1_82.dll
481-
boost_date_time-vc142-mt-gd-x64-1_82.dll
482-
boost_filesystem-vc142-mt-gd-x64-1_82.dll
483-
boost_thread-vc142-mt-gd-x64-1_82.dll
484-
boost_regex-vc142-mt-gd-x64-1_82.dll
480+
boost_coroutine-vc142-mt-gd-x64-1_83.dll
481+
boost_date_time-vc142-mt-gd-x64-1_83.dll
482+
boost_filesystem-vc142-mt-gd-x64-1_83.dll
483+
boost_thread-vc142-mt-gd-x64-1_83.dll
484+
boost_regex-vc142-mt-gd-x64-1_83.dll
485485
libssl-3_0-x64.dll
486486
libcrypto-3_0-x64.dll
487487
WS2_32.dll
488488
dbghelp.dll
489489
SHLWAPI.dll
490490
msi.dll
491-
boost_unit_test_framework-vc142-mt-gd-x64-1_82.dll
491+
boost_unit_test_framework-vc142-mt-gd-x64-1_83.dll
492492
KERNEL32.dll
493493
SHELL32.dll
494494
ADVAPI32.dll
@@ -1763,7 +1763,7 @@ mkdir build
17631763
cd .\build\
17641764
17651765
& "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" `
1766-
-DICINGA2_UNITY_BUILD=OFF -DBoost_INCLUDE_DIR=C:\local\boost_1_82_0-Win64 `
1766+
-DICINGA2_UNITY_BUILD=OFF -DBoost_INCLUDE_DIR=C:\local\boost_1_83_0-Win64 `
17671767
-DBISON_EXECUTABLE=C:\ProgramData\chocolatey\lib\winflexbison3\tools\win_bison.exe `
17681768
-DFLEX_EXECUTABLE=C:\ProgramData\chocolatey\lib\winflexbison3\tools\win_flex.exe `
17691769
-DICINGA2_WITH_MYSQL=OFF -DICINGA2_WITH_PGSQL=OFF ..
@@ -1936,29 +1936,29 @@ Download the [boost-binaries](https://sourceforge.net/projects/boost/files/boost
19361936
- 64 for 64 bit builds
19371937

19381938
```
1939-
https://sourceforge.net/projects/boost/files/boost-binaries/1.82.0/boost_1_82_0-msvc-14.2-64.exe/download
1939+
https://sourceforge.net/projects/boost/files/boost-binaries/1.82.0/boost_1_83_0-msvc-14.2-64.exe/download
19401940
```
19411941

1942-
Run the installer and leave the default installation path in `C:\local\boost_1_82_0`.
1942+
Run the installer and leave the default installation path in `C:\local\boost_1_83_0`.
19431943

19441944

19451945
##### Source & Compile
19461946

19471947
In order to use the boost development header and library files you need to [download](https://www.boost.org/users/download/)
1948-
Boost and then extract it to e.g. `C:\local\boost_1_82_0`.
1948+
Boost and then extract it to e.g. `C:\local\boost_1_83_0`.
19491949

19501950
> **Note**
19511951
>
19521952
> Just use `C:\local`, the zip file already contains the sub folder. Extraction takes a while,
19531953
> the archive contains more than 70k files.
19541954
19551955
In order to integrate Boost into Visual Studio, open the `Developer Command Prompt` from the start menu,
1956-
and navigate to `C:\local\boost_1_82_0`.
1956+
and navigate to `C:\local\boost_1_83_0`.
19571957

19581958
Execute `bootstrap.bat` first.
19591959

19601960
```
1961-
cd C:\local\boost_1_82_0
1961+
cd C:\local\boost_1_83_0
19621962
bootstrap.bat
19631963
```
19641964

@@ -2041,8 +2041,8 @@ You need to specify the previously installed component paths.
20412041

20422042
Variable | Value | Description
20432043
----------------------|----------------------------------------------------------------------|-------------------------------------------------------
2044-
`BOOST_ROOT` | `C:\local\boost_1_82_0` | Root path where you've extracted and compiled Boost.
2045-
`BOOST_LIBRARYDIR` | Binary: `C:\local\boost_1_82_0\lib64-msvc-14.2`, Source: `C:\local\boost_1_82_0\stage` | Path to the static compiled Boost libraries, directory must contain `lib`.
2044+
`BOOST_ROOT` | `C:\local\boost_1_83_0` | Root path where you've extracted and compiled Boost.
2045+
`BOOST_LIBRARYDIR` | Binary: `C:\local\boost_1_83_0\lib64-msvc-14.2`, Source: `C:\local\boost_1_83_0\stage` | Path to the static compiled Boost libraries, directory must contain `lib`.
20462046
`BISON_EXECUTABLE` | `C:\ProgramData\chocolatey\lib\winflexbison\tools\win_bison.exe` | Path to the Bison executable.
20472047
`FLEX_EXECUTABLE` | `C:\ProgramData\chocolatey\lib\winflexbison\tools\win_flex.exe` | Path to the Flex executable.
20482048
`ICINGA2_WITH_MYSQL` | OFF | Requires extra setup for MySQL if set to `ON`. Not supported for client setups.
@@ -2079,8 +2079,8 @@ $env:ICINGA2_INSTALLPATH = 'C:\Program Files\Icinga2-debug'
20792079
$env:ICINGA2_BUILDPATH='debug'
20802080
$env:CMAKE_BUILD_TYPE='Debug'
20812081
$env:OPENSSL_ROOT_DIR='C:\OpenSSL-Win64'
2082-
$env:BOOST_ROOT='C:\local\boost_1_82_0'
2083-
$env:BOOST_LIBRARYDIR='C:\local\boost_1_82_0\lib64-msvc-14.2'
2082+
$env:BOOST_ROOT='C:\local\boost_1_83_0'
2083+
$env:BOOST_LIBRARYDIR='C:\local\boost_1_83_0\lib64-msvc-14.2'
20842084
```
20852085

20862086
#### Icinga 2 in Visual Studio

doc/win-dev.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ function ThrowOnNativeFailure {
1313

1414
$VsVersion = 2019
1515
$MsvcVersion = '14.2'
16-
$BoostVersion = @(1, 82, 0)
17-
$OpensslVersion = '3_0_9'
16+
$BoostVersion = @(1, 83, 0)
17+
$OpensslVersion = '3_0_12'
1818

1919
switch ($Env:BITS) {
2020
32 { }

lib/base/tlsutility.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#include <boost/asio/ssl/context.hpp>
1212
#include <openssl/opensslv.h>
1313
#include <openssl/crypto.h>
14+
#include <openssl/ssl.h>
15+
#include <openssl/ssl3.h>
1416
#include <fstream>
1517

1618
namespace icinga
@@ -91,6 +93,16 @@ static void InitSslContext(const Shared<boost::asio::ssl::context>::Ptr& context
9193

9294
flags |= SSL_OP_CIPHER_SERVER_PREFERENCE;
9395

96+
#if OPENSSL_VERSION_NUMBER < 0x10100000L
97+
SSL_CTX_set_info_callback(sslContext, [](const SSL* ssl, int where, int) {
98+
if (where & SSL_CB_HANDSHAKE_DONE) {
99+
ssl->s3->flags |= SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS;
100+
}
101+
});
102+
#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */
103+
flags |= SSL_OP_NO_RENEGOTIATION;
104+
#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
105+
94106
SSL_CTX_set_options(sslContext, flags);
95107

96108
SSL_CTX_set_mode(sslContext, SSL_MODE_ENABLE_PARTIAL_WRITE | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);

lib/icingadb/icingadb-objects.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,6 +1570,9 @@ IcingaDB::CreateConfigUpdate(const ConfigObject::Ptr& object, const String typeN
15701570

15711571
void IcingaDB::SendConfigDelete(const ConfigObject::Ptr& object)
15721572
{
1573+
if (!m_Rcon || !m_Rcon->IsConnected())
1574+
return;
1575+
15731576
Type::Ptr type = object->GetReflectionType();
15741577
String typeName = type->GetName().ToLower();
15751578
String objectKey = GetObjectIdentifier(object);
@@ -1853,6 +1856,7 @@ void IcingaDB::SendStartedDowntime(const Downtime::Ptr& downtime)
18531856
"scheduled_end_time", Convert::ToString(TimestampToMilliseconds(downtime->GetEndTime())),
18541857
"has_been_cancelled", Convert::ToString((unsigned short)downtime->GetWasCancelled()),
18551858
"trigger_time", Convert::ToString(TimestampToMilliseconds(downtime->GetTriggerTime())),
1859+
"cancel_time", Convert::ToString(TimestampToMilliseconds(downtime->GetRemoveTime())),
18561860
"event_id", CalcEventID("downtime_start", downtime),
18571861
"event_type", "downtime_start"
18581862
});

tools/win32/configure-dev.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ if (-not (Test-Path env:OPENSSL_ROOT_DIR)) {
3131
$env:OPENSSL_ROOT_DIR = 'c:\local\OpenSSL-Win64'
3232
}
3333
if (-not (Test-Path env:BOOST_ROOT)) {
34-
$env:BOOST_ROOT = 'c:\local\boost_1_82_0'
34+
$env:BOOST_ROOT = 'c:\local\boost_1_83_0'
3535
}
3636
if (-not (Test-Path env:BOOST_LIBRARYDIR)) {
37-
$env:BOOST_LIBRARYDIR = 'c:\local\boost_1_82_0\lib64-msvc-14.2'
37+
$env:BOOST_LIBRARYDIR = 'c:\local\boost_1_83_0\lib64-msvc-14.2'
3838
}
3939
if (-not (Test-Path env:FLEX_BINARY)) {
4040
$env:FLEX_BINARY = 'C:\ProgramData\chocolatey\bin\win_flex.exe'

tools/win32/configure.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ if (-not (Test-Path env:CMAKE_GENERATOR_PLATFORM)) {
3030
}
3131
}
3232
if (-not (Test-Path env:OPENSSL_ROOT_DIR)) {
33-
$env:OPENSSL_ROOT_DIR = "c:\local\OpenSSL_3_0_9-Win${env:BITS}"
33+
$env:OPENSSL_ROOT_DIR = "c:\local\OpenSSL_3_0_12-Win${env:BITS}"
3434
}
3535
if (-not (Test-Path env:BOOST_ROOT)) {
36-
$env:BOOST_ROOT = "c:\local\boost_1_82_0-Win${env:BITS}"
36+
$env:BOOST_ROOT = "c:\local\boost_1_83_0-Win${env:BITS}"
3737
}
3838
if (-not (Test-Path env:BOOST_LIBRARYDIR)) {
39-
$env:BOOST_LIBRARYDIR = "c:\local\boost_1_82_0-Win${env:BITS}\lib${env:BITS}-msvc-14.2"
39+
$env:BOOST_LIBRARYDIR = "c:\local\boost_1_83_0-Win${env:BITS}\lib${env:BITS}-msvc-14.2"
4040
}
4141
if (-not (Test-Path env:FLEX_BINARY)) {
4242
$env:FLEX_BINARY = 'C:\ProgramData\chocolatey\bin\win_flex.exe'

0 commit comments

Comments
 (0)