2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
42#include "core/socket/stream/tls/TLSHandshake.h"
44#ifndef DOXYGEN_SHOULD_SKIP_THIS
46#include <openssl/ssl.h>
54 const std::function<
void(
void)>& onSuccess,
55 const std::function<
void(
void)>& onTimeout,
56 const std::function<
void(
int)>& onStatus,
57 const utils::
Timeval& timeout) {
63 const std::function<
void(
void)>& onSuccess,
64 const std::function<
void(
void)>& onTimeout,
65 const std::function<
void(
int)>& onStatus,
74 ,
fd(SSL_get_fd(ssl)) {
75 const int ret = SSL_do_handshake(ssl);
77 int sslErr = SSL_ERROR_NONE;
79 sslErr = SSL_get_error(ssl, ret);
91 case SSL_ERROR_WANT_READ:
94 case SSL_ERROR_WANT_WRITE:
98 case SSL_ERROR_ZERO_RETURN:
113 const int ret = SSL_do_handshake(
ssl);
115 int sslErr = SSL_ERROR_NONE;
117 sslErr = SSL_get_error(
ssl, ret);
121 case SSL_ERROR_WANT_READ:
123 case SSL_ERROR_WANT_WRITE:
128 case SSL_ERROR_ZERO_RETURN:
142 const int ret = SSL_do_handshake(
ssl);
144 int sslErr = SSL_ERROR_NONE;
146 sslErr = SSL_get_error(
ssl, ret);
150 case SSL_ERROR_WANT_READ:
154 case SSL_ERROR_WANT_WRITE:
157 case SSL_ERROR_ZERO_RETURN:
ReadEventReceiver(const std::string &name, const utils::Timeval &timeout)
WriteEventReceiver(const std::string &name, const utils::Timeval &timeout)
void signalEvent(int signum) final
void writeTimeout() final
static void doHandshake(const std::string &instanceName, SSL *ssl, const std::function< void(void)> &onSuccess, const std::function< void(void)> &onTimeout, const std::function< void(int)> &onStatus, const utils::Timeval &timeout)
TLSHandshake(const std::string &instanceName, SSL *ssl, const std::function< void(void)> &onSuccess, const std::function< void(void)> &onTimeout, const std::function< void(int)> &onStatus, const utils::Timeval &timeout)
std::function< void(void)> onTimeout
std::function< void(int)> onStatus
std::function< void(void)> onSuccess
void unobservedEvent() final