File tree 2 files changed +36
-1
lines changed
2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change 20
20
#include < boost/asio/ssl/context.hpp>
21
21
#include < boost/asio/ssl/stream.hpp>
22
22
23
+ #ifdef _WIN32
24
+ # include < boost/wintls.hpp>
25
+ #endif /* _WIN32 */
26
+
23
27
namespace icinga
24
28
{
25
29
@@ -63,7 +67,30 @@ struct UnbufferedAsioTlsStreamParams
63
67
const String& Hostname;
64
68
};
65
69
66
- typedef SeenStream<boost::asio::ssl::stream<boost::asio::ip::tcp::socket>> AsioTcpTlsStream;
70
+ #ifdef _WIN32
71
+ template <class T >
72
+ class TlsStream : public boost ::wintls::stream<T>
73
+ {
74
+ public:
75
+ using boost::wintls::stream<T>::stream;
76
+
77
+ typedef typename next_layer_type::lowest_layer_type lowest_layer_type;
78
+ typedef boost::wintls::handshake_type handshake_type;
79
+
80
+ static constexpr auto client = boost::wintls::handshake_type::client;
81
+ static constexpr auto server = boost::wintls::handshake_type::server;
82
+
83
+ lowest_layer_type& lowest_layer ()
84
+ {
85
+ return next_layer ().lowest_layer ();
86
+ }
87
+ };
88
+ #else /* _WIN32 */
89
+ template <class T >
90
+ using TlsStream = boost::asio::ssl::stream<T>;
91
+ #endif /* _WIN32 */
92
+
93
+ typedef SeenStream<TlsStream<boost::asio::ip::tcp::socket>> AsioTcpTlsStream;
67
94
68
95
class UnbufferedAsioTlsStream : public AsioTcpTlsStream
69
96
{
Original file line number Diff line number Diff line change 22
22
#include < boost/asio/ssl/context.hpp>
23
23
#include < boost/exception/info.hpp>
24
24
25
+ #ifdef _WIN32
26
+ # include < boost/wintls/context.hpp>
27
+ #endif /* _WIN32 */
28
+
25
29
namespace icinga
26
30
{
27
31
@@ -38,7 +42,11 @@ const auto LEAF_VALID_FOR = 60 * 60 * 24 * 397;
38
42
const auto RENEW_THRESHOLD = 60 * 60 * 24 * 30 ;
39
43
const auto RENEW_INTERVAL = 60 * 60 * 24 ;
40
44
45
+ #ifdef _WIN32
46
+ typedef boost::wintls::context TlsContext;
47
+ #else /* _WIN32 */
41
48
typedef boost::asio::ssl::context TlsContext;
49
+ #endif /* _WIN32 */
42
50
43
51
typedef int TlsProtocolMin;
44
52
You can’t perform that action at this time.
0 commit comments