00001 /* 00002 * shttpsvc.h 00003 * 00004 * Class for secure service applications using HTTPS as the user interface. 00005 * 00006 * Portable Windows Library 00007 * 00008 * Copyright (c) 1993-2001 Equivalence Pty. Ltd. 00009 * 00010 * The contents of this file are subject to the Mozilla Public License 00011 * Version 1.0 (the "License"); you may not use this file except in 00012 * compliance with the License. You may obtain a copy of the License at 00013 * http://www.mozilla.org/MPL/ 00014 * 00015 * Software distributed under the License is distributed on an "AS IS" 00016 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00017 * the License for the specific language governing rights and limitations 00018 * under the License. 00019 * 00020 * The Original Code is Portable Windows Library. 00021 * 00022 * The Initial Developer of the Original Code is Equivalence Pty. Ltd. 00023 * 00024 * Contributor(s): ______________________________________. 00025 * 00026 * $Log: shttpsvc.h,v $ 00027 * Revision 1.7 2004/04/24 03:58:15 rjongbloed 00028 * Allow for run time enable/disable of secure web access to HTTP process, 00029 * changed from old debug only hack to "correct" usager. Thanks Ben Lear 00030 * 00031 * Revision 1.6 2002/09/16 01:08:59 robertj 00032 * Added #define so can select if #pragma interface/implementation is used on 00033 * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan. 00034 * 00035 * Revision 1.5 2002/08/05 05:40:45 robertj 00036 * Fixed missing pragma interface/implementation 00037 * 00038 * Revision 1.4 2001/12/13 09:19:09 robertj 00039 * Added ability to create HTTP server certificate if one does not exist. 00040 * 00041 * Revision 1.3 2001/05/16 06:02:05 craigs 00042 * Changed to allow detection of non-SSL connection to SecureHTTPServiceProcess 00043 * 00044 * Revision 1.2 2001/03/27 03:56:01 craigs 00045 * Added hack to allow secure servers to act as non-secure servers 00046 * 00047 * Revision 1.1 2001/02/15 02:41:14 robertj 00048 * Added class to do secure HTTP based service process. 00049 * 00050 */ 00051 00052 #ifndef SHTTPSVC_H 00053 #define SHTTPSVC_H 00054 00055 #ifdef P_USE_PRAGMA 00056 #pragma interface 00057 #endif 00058 00059 00060 #include <ptclib/httpsvc.h> 00061 #include <ptclib/pssl.h> 00062 00063 00065 00066 class PSecureHTTPServiceProcess : public PHTTPServiceProcess 00067 { 00068 PCLASSINFO(PSecureHTTPServiceProcess, PHTTPServiceProcess) 00069 00070 public: 00071 PSecureHTTPServiceProcess(const Info & inf); 00072 ~PSecureHTTPServiceProcess(); 00073 00074 virtual PHTTPServer * CreateHTTPServer(PTCPSocket & socket); 00075 00076 BOOL SetServerCertificate( 00077 const PFilePath & certFile, 00078 BOOL create = FALSE, 00079 const char * dn = NULL 00080 ); 00081 00082 virtual BOOL OnDetectedNonSSLConnection(PChannel * chan, const PString & line); 00083 00084 virtual PString CreateNonSSLMessage(const PString & url); 00085 virtual PString CreateRedirectMessage(const PString & url); 00086 00087 protected: 00088 PSSLContext * sslContext; 00089 BOOL disableSSL; 00090 }; 00091 00092 00093 #endif // SHTTPSVC_H