SourcePro® C++ API Reference Guide

Product Documentation:
   SourcePro C++
Documentation Home
List of all members | Public Member Functions
RWSecureSocketMethod Class Reference

Encapsulates the various TLS/SSL protocol versions. An instance of this class is required to construct an RWSecureSocketContext object. More...

#include <rw/secsock/RWSecureSocketMethod.h>

Public Member Functions

 RWSecureSocketMethod (const SSL_METHOD *meth)
 
 operator const SSL_METHOD * () const
 

Detailed Description

RWSecureSocketMethod encapsulates the various TLS/SSL protocol versions. An instance of this class is required to construct an RWSecureSocketContext object.

The Secure Sockets package used to provide a static instance of this class for each available TLS/SSL protocol version. Unfortunately, this solution suffered from static initialization order problems when global instances of RWSecureSocketContext were used. We replaced the static instances with identically named static pointers to the corresponding underlying cryptography library functions, and added a constructor that converts these pointers to functions into RWSecureSocketMethod instances. This change allows code previously written to function identically with no code changes, and only a recompile.

The following table lists the provided static function pointers:

Static Constant Name TLS or SSL Version
TLSv1WithFallback TLS version 1, either side of protocol, with fallback to SSL version 3 (if OPENSSL_NO_SSL3 is not defined), and then SSL version 2 (if OPENSSL_NO_SSL2 is not defined). This is the default when creating RWSecureSocketContext objects.
TLSv1ClientWithFallback TLS version 1, client side only, with fallback to SSL version 3 (if OPENSSL_NO_SSL3 is not defined), and then SSL version 2 (if OPENSSL_NO_SSL2 is not defined).
TLSv1ServerWithFallback TLS version 1, server side only, with fallback to SSL version 3 (if OPENSSL_NO_SSL3 is not defined), and then SSL version 2 (if OPENSSL_NO_SSL2 is not defined).
DTLSv1 DTLS version 1 only, either side of protocol. (Since OpenSSL 1.0.1)
DTLSv1Client DTLS version 1 only, client side only. (Since OpenSSL 1.0.1)
DTLSv1Server DTLS version 1 only, server side only. (Since OpenSSL 1.0.1)
TLSv1_2 TLS version 1.2 only, either side of protocol. (Since OpenSSL 1.0.1)
TLSv1_2Client TLS version 1.2 only, client side only. (Since OpenSSL 1.0.1)
TLSv1_2Server TLS version 1.2 only, server side only. (Since OpenSSL 1.0.1)
TLSv1_1 TLS version 1.1 only, either side of protocol. (Since OpenSSL 1.0.1)
TLSv1_1Client TLS version 1.1 only, client side only. (Since OpenSSL 1.0.1)
TLSv1_1Server TLS version 1.1 only, server side only. (Since OpenSSL 1.0.1)
TLSv1 TLS version 1 only, either side of protocol.
TLSv1Client TLS version 1 only, client side only.
TLSv1Server TLS version 1 only, server side only.
SSLv3 Deprecated. SSL version 3 only, either side of protocol. Using this method throws an RWSecureSocketInvalidMethodError if OPENSSL_NO_SSL3 is defined.
SSLv3Client Deprecated. SSL version 3 only, client side only. Using this method throws an RWSecureSocketInvalidMethodError if OPENSSL_NO_SSL3 is defined.
SSLv3Server Deprecated. SSL version 3 only, server side only. Using this method throws an RWSecureSocketInvalidMethodError if OPENSSL_NO_SSL3 is defined.
SSLv2 Deprecated. SSL version 2 only, either side of protocol. Using this method throws an RWSecureSocketInvalidMethodError if OPENSSL_NO_SSL2 is defined.
SSLv2Client Deprecated. SSL version 2 only, client side only. Using this method throws an RWSecureSocketInvalidMethodError if OPENSSL_NO_SSL2 is defined.
SSLv2Server Deprecated. SSL version 2 only, server side only. Using this method throws an RWSecureSocketInvalidMethodError if OPENSSL_NO_SSL2 is defined.

Constructor & Destructor Documentation

RWSecureSocketMethod::RWSecureSocketMethod ( const SSL_METHOD *  meth)
Exceptions
RWSecureSocketInvalidMethodErrorThrown if meth is NULL. You will not normally use this constructor directly.

Member Function Documentation

RWSecureSocketMethod::operator const SSL_METHOD * ( ) const
inline

Conversion operator.

Copyright © 2016 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.