3
//=============================================================================
5
* @file SSLIOP_Accept_Strategy.h
7
* SSLIOP_Accept_Strategy.h,v 1.2 2003/07/21 23:51:33 dhinton Exp
9
* IIOP/SSL specific accept strategy
11
* @author Ossama Othman <ossama@uci.edu>
13
//=============================================================================
16
#ifndef TAO_SSLIOP_ACCEPT_STRATEGY_H
17
#define TAO_SSLIOP_ACCEPT_STRATEGY_H
19
#include /**/ "ace/pre.h"
21
#include "ace/config-all.h"
23
#if !defined (ACE_LACKS_PRAGMA_ONCE)
25
#endif /* ACE_LACKS_PRAGMA_ONCE */
27
#include "SSLIOP_Connection_Handler.h"
29
#include "tao/Acceptor_Impl.h"
31
#include "ace/SSL/SSL_SOCK_Acceptor.h"
35
* @class TAO_SSLIOP_Accept_Strategy
37
* @brief SSLIOP-specific accept strategy that builds on the
38
* TAO_Accept_Strategy implementation.
40
* This accept strategy builds on on the TAO_Accept_Strategy
41
* implementation. It sub-classes that class, and overrides the
42
* accept_svc_handler() method so that a timeout value may be passed
43
* to the underlying peer acceptor. This is necessary to defend
44
* against a simple Denial-of-Service attack.
46
* Since SSL requires two handshakes, one TCP and one SSL, it is
47
* possible for a malicious client to establish a TCP connection to
48
* the SSL port, and never complete the SSL handshake. The underlying
49
* SSL passive connection code would block/hang waiting for the SSL
50
* handshake to complete. Given enough incomplete connections where
51
* only the TCP handshake is completed, a server process could
52
* potentially run out of available file descriptors, thus preventing
53
* legitimate client connections from being established.
55
* The timeout defense alluded to above bounds the time this sort of
58
class TAO_SSLIOP_Accept_Strategy
59
: public TAO_Accept_Strategy<TAO_SSLIOP_Connection_Handler,
60
ACE_SSL_SOCK_ACCEPTOR>
65
TAO_SSLIOP_Accept_Strategy (TAO_ORB_Core * orb_core,
66
const ACE_Time_Value & timeout);
68
/// Overridden method that forces a passive connection timeout value
69
/// to be passed to the underlying acceptor.
70
virtual int accept_svc_handler (handler_type * svc_handler);
74
/// The accept() timeout.
76
* This timeout includes the overall time to complete the SSL
77
* handshake. This includes both the TCP handshake and the SSL
80
const ACE_Time_Value timeout_;
85
#include /**/ "ace/post.h"
87
#endif /* TAO_SSLIOP_ACCEPT_STRATEGY_H */