Module: Secure Communication Module Package: HTTPS
Does not inherit
#include <rw/https/RWHttpsSecurityManager.h>
RWHttpsSecurityManager sets various parameters of the HTTPS package, such as:
The default context for all RWHttpAgents using "https" URIs
Various security-related callbacks
typedef RWTFunctorR2<bool,RWCString,RWX509Certificate> RWHttpsNameCheckCallback; typedef RWTFunctor2<RWCString,RWX509Certificate> RWHttpsNameMismatchCallback;
bool defaultNameCheckCallback(const RWCString& host, const RWX509Certificate& cert)
This is the default name check callback. It is called immediately following the SSL/TLS handshake to compare the Common Name field in the certificate with the host parameter. Wildcard name matching is supported and the matching is case-insensitive. Returns true if the names are the same, and returns false otherwise. When this function returns false, the certificate name mismatch callback is called. The RWCString should contain 7-bit US-ASCII data.
You can supply a name check callback using the function RWHttpsSecurityManager::setNameCheckCallback() if more stringent name checking is required.
void defaultNameMismatchCallback(const RWCString& host, const RWX509Certificate& cert)
This is the default name mismatch callback. It is called when the name check callback determines that the name in the certificate does not match the name of the actual server. This function throws an RWHttpsCertificateNameMismatch exception. The RWCString should contain 7-bit US-ASCII data.
RWHttpsNameCheckCallback getNameCheckCallback();
Returns the name check callback.
RWHttpsNameMismatchCallback getNameMismatchCallback();
Returns the certificate name mismatch callback.
void setAgentContext(const RWSecureSocketContext& ctx);
Registers the https scheme and functor with the singleton connection manager. After making this call, you can use https URLs with class RWHttpAgent. The context provided is used for all agents created in a program.
void setNameCheckCallback(const RWHttpsNameCheckCallback& nameCB);
Sets a custom certificate name check callback. The default behavior of this callback is described under defaultNameCheckCallback() in this class description.
void setNameMismatchCallback(const RWHttpsNameMismatchCallback& nameCB);
Sets a custom certificate name mismatch callback. The default behavior of this callback is described under defaultNameMismatchCallback() in this class description. See also Section 7.4.2, "Certificate Name Mismatch Callback," in the Secure Communication Module User's Guide and Section 8.1, "Supplying Your Own Callbacks," in the Secure Communication Module User's Guide.
© Copyright 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.
Contact Rogue Wave about documentation or support issues.