File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
storage/ndb/src/common/transporter Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 47
47
#define DEBUG_FPRINTF (a )
48
48
#endif
49
49
50
- // #define DEBUG_MULTI_TRP 1
50
+ // #define DEBUG_MULTI_TRP 1
51
51
52
52
#ifdef DEBUG_MULTI_TRP
53
53
#define DEB_MULTI_TRP (arglist ) \
@@ -324,15 +324,18 @@ bool Transporter::connect_client() {
324
324
struct ssl_st *ssl = NdbSocket::get_client_ssl (ctx);
325
325
if (ssl == nullptr ) {
326
326
tls_error (TlsKeyError::no_local_cert);
327
+ secureSocket.close ();
327
328
DBUG_RETURN (false );
328
329
}
329
330
if (!secureSocket.associate (ssl)) {
330
331
tls_error (TlsKeyError::openssl_error);
331
332
NdbSocket::free_ssl (ssl);
333
+ secureSocket.close ();
332
334
DBUG_RETURN (false );
333
335
}
334
336
if (!secureSocket.do_tls_handshake ()) {
335
337
tls_error (TlsKeyError::authentication_failure);
338
+ // secureSocket closed by do_tls_handshake
336
339
DBUG_RETURN (false );
337
340
}
338
341
@@ -341,6 +344,7 @@ bool Transporter::connect_client() {
341
344
TlsKeyManager::check_server_host_auth (secureSocket, remoteHostName);
342
345
if (auth) {
343
346
tls_error (auth);
347
+ secureSocket.close ();
344
348
DBUG_RETURN (false );
345
349
}
346
350
}
Original file line number Diff line number Diff line change @@ -129,13 +129,22 @@ SocketServer::Session *TransporterService::newSession(
129
129
struct ssl_ctx_st *ctx = m_transporter_registry->m_tls_keys .ctx ();
130
130
struct ssl_st *ssl = NdbSocket::get_server_ssl (ctx);
131
131
if (ssl == nullptr ) {
132
+ DEBUG_FPRINTF ((stderr,
133
+ " Failed to authenticate new session, no server "
134
+ " cerificate\n " ));
135
+ secureSocket.close_with_reset ();
132
136
DBUG_RETURN (nullptr );
133
137
}
134
138
if (!secureSocket.associate (ssl)) {
139
+ DEBUG_FPRINTF ((stderr,
140
+ " Failed to authenticate new session, fail to "
141
+ " associate certificate with connection\n " ));
135
142
NdbSocket::free_ssl (ssl);
143
+ secureSocket.close_with_reset ();
136
144
DBUG_RETURN (nullptr );
137
145
}
138
146
if (!secureSocket.do_tls_handshake ()) {
147
+ // secureSocket closed by do_tls_handshake
139
148
DBUG_RETURN (nullptr );
140
149
}
141
150
}
You can’t perform that action at this time.
0 commit comments