PTLib  Version 2.18.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
shttpsvc.h
Go to the documentation of this file.
1 /*
2  * shttpsvc.h
3  *
4  * Class for secure service applications using HTTPS as the user interface.
5  *
6  * Portable Windows Library
7  *
8  * Copyright (c) 1993-2001 Equivalence Pty. Ltd.
9  *
10  * The contents of this file are subject to the Mozilla Public License
11  * Version 1.0 (the "License"); you may not use this file except in
12  * compliance with the License. You may obtain a copy of the License at
13  * http://www.mozilla.org/MPL/
14  *
15  * Software distributed under the License is distributed on an "AS IS"
16  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17  * the License for the specific language governing rights and limitations
18  * under the License.
19  *
20  * The Original Code is Portable Windows Library.
21  *
22  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
23  *
24  * Contributor(s): ______________________________________.
25  */
26 
27 #ifndef PTLIB_SHTTPSVC_H
28 #define PTLIB_SHTTPSVC_H
29 
30 #ifdef P_USE_PRAGMA
31 #pragma interface
32 #endif
33 
34 
35 #include <ptclib/httpsvc.h>
36 #include <ptclib/pssl.h>
37 
38 
40 
42 {
44 
45  public:
46  PSecureHTTPServiceProcess(const Info & inf);
48 
50  {
51  Params(
52  const char * configPageName,
53  const char * section = GetDefaultSection()
54  );
55 
56  const char * m_certificateFileKey;
57  const char * m_createCertificateKey;
58  };
59 
60  virtual bool InitialiseBase(
62  );
63 
64  virtual PChannel * CreateChannelForHTTP(PChannel * channel);
65  virtual void OnHTTPStarted(PHTTPServer & server);
66 
71  const PFilePath & certFile,
72  bool create = false,
73  const char * dn = NULL
74  );
75 
80  const PString & cert,
81  const PString & key,
82  const PString & ca
83  );
84 
85  virtual PBoolean OnDetectedNonSSLConnection(PChannel * chan, const PString & line);
86 
87  virtual PString CreateNonSSLMessage(const PString & url);
88  virtual PString CreateRedirectMessage(const PString & url);
89 
90  void DisableSSL();
91 
92  protected:
94 };
95 
96 
97 #endif // PTLIB_SHTTPSVC_H
98 
99 
100 // End Of File ///////////////////////////////////////////////////////////////
Params(const char *configPageName, const char *section=GetDefaultSection())
Definition: httpsvc.h:52
virtual PBoolean OnDetectedNonSSLConnection(PChannel *chan, const PString &line)
static const PString & GetDefaultSection()
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:2164
PSSLContext * m_sslContext
Definition: shttpsvc.h:93
Definition: httpsvc.h:101
This class describes a full description for a file on the particular platform.
Definition: filepath.h:61
const char * m_createCertificateKey
Definition: shttpsvc.h:57
const char * m_certificateFileKey
Definition: shttpsvc.h:56
Abstract class defining I/O channel semantics.
Definition: channel.h:103
bool PBoolean
Definition: object.h:174
virtual PString CreateNonSSLMessage(const PString &url)
The character string class.
Definition: pstring.h:108
Context for SSL channels.
Definition: pssl.h:718
virtual PString CreateRedirectMessage(const PString &url)
bool SetServerCredentials(const PString &cert, const PString &key, const PString &ca)
Set the server credentials, certificates etc, to use.
virtual void OnHTTPStarted(PHTTPServer &server)
Callback when a new HTTP connection has begun.
virtual bool InitialiseBase(PHTTPServiceProcess::Params &params)
Definition: shttpsvc.h:49
bool SetServerCertificate(const PFilePath &certFile, bool create=false, const char *dn=NULL)
Set/Create the server certificate to use.
PSecureHTTPServiceProcess(const Info &inf)
Definition: httpsvc.h:44
A TCP/IP socket for the HyperText Transfer Protocol version 1.0.
Definition: http.h:1042
virtual PChannel * CreateChannelForHTTP(PChannel *channel)
Call back to create transport socket, or TLS, channel.
Definition: shttpsvc.h:41