MityDSP Documentation Index

tcSslDefaultHelper

Introduction

The tcSslDefaultHelper class is derived from the tcDspNetSslHelper pure virtual base class, and is used to provide a Secure Socket Layer interface for tcDspNetClientHttp using the XySSL library.

Most applications should be able to use this default helper as-is, but others will need to derive their own customized version if different SSL options are required (e.g., check certificate validity with a CA chain, change encryption schemes offered, cheange timeouts, etc.).

Note:
The helper class is kept separate from the tcDspNetClientHttp class so applications that do not require a SSL interface do not incur the overhead of importing the XySSL library.
See also:
MityDSP::tcSslDefaultHelper Class Reference
MityDSP::tcDspNetClientHttp Class Reference

Example

This is a simple example of how to use tcSslDefaultHelper with tcDspNetClientHttp:

 #include <net/clients/DSPNetClientHttp.h>
 #include <XySSL_port/SslDefaultHelper.h>

 // GET a secure web page...
 {
     tcDspNetClientHttp::teHttpReturn rv;
     const char         *url = "https://www.fortify.net/sslcheck.html";
     static char        buffer[8192], mime[tcDspNetClientHttp::gnMimeLength];
     tcDspNetClientHttp *mpHttp = new tcDspNetClientHttp;
     tcSslDefaultHelper *mpSslHelper = new tcSslDefaultHelper;

     // assign helper to HTTP client, to allow HTTPS connections
     mpHttp->ssl_helper(mpSslHelper);

     int len = sizeof(buffer);
     rv = mpHttp->get(url, (void *)buffer, len, mime);
     printf("HTTP returned: %1d\r\n", (int)rv);
     printf("MIME-type: %s\r\n", (strlen(mime) > 0) ? mime : "unknown");

     :
 } 

  
Generated on Wed Mar 17 18:24:41 2010 for MityDSP XySSL Port by  Doxygen Version 1.6.1
Copyright © 2009, Critical Link LLC, All rights reserved.