1
#if !defined(RESIP_TLSTRANSPORT_HXX)
2
#define RESIP_TLSTRANSPORT_HXX
4
#if defined(HAVE_CONFIG_H)
9
#include "resip/stack/TcpBaseTransport.hxx"
10
#include "resip/stack/SecurityTypes.hxx"
11
#include "rutil/HeapInstanceCounter.hxx"
12
#include "resip/stack/Compression.hxx"
14
#include <openssl/ssl.h>
23
class TlsTransport : public TcpBaseTransport
26
RESIP_HeapCount(TlsTransport);
27
TlsTransport(Fifo<TransactionMessage>& fifo,
30
const Data& interfaceObj,
32
const Data& sipDomain,
33
SecurityTypes::SSLType sslType,
34
AfterSocketCreationFuncPtr socketFunc=0,
35
Compression &compression = Compression::Disabled,
36
unsigned transportFlags = 0,
37
SecurityTypes::TlsClientVerificationMode cvm = SecurityTypes::None,
38
bool useEmailAsSIP = false);
39
virtual ~TlsTransport();
41
TransportType transport() const { return TLS; }
42
SSL_CTX* getCtx() const;
44
SecurityTypes::TlsClientVerificationMode getClientVerificationMode()
45
{ return mClientVerificationMode; };
46
bool isUseEmailAsSIP()
47
{ return mUseEmailAsSIP; };
50
Connection* createConnection(const Tuple& who, Socket fd, bool server=false);
53
SecurityTypes::SSLType mSslType;
55
SecurityTypes::TlsClientVerificationMode mClientVerificationMode;
56
/* If true, we will accept the email address in a client's subjectAltName
57
as if it were a SIP URI. This is convenient because many commercial
58
CAs offer email certificates but not sip: certificates */
66
/* ====================================================================
67
* The Vovida Software License, Version 1.0
69
* Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
71
* Redistribution and use in source and binary forms, with or without
72
* modification, are permitted provided that the following conditions
75
* 1. Redistributions of source code must retain the above copyright
76
* notice, this list of conditions and the following disclaimer.
78
* 2. Redistributions in binary form must reproduce the above copyright
79
* notice, this list of conditions and the following disclaimer in
80
* the documentation and/or other materials provided with the
83
* 3. The names "VOCAL", "Vovida Open Communication Application Library",
84
* and "Vovida Open Communication Application Library (VOCAL)" must
85
* not be used to endorse or promote products derived from this
86
* software without prior written permission. For written
87
* permission, please contact vocal@vovida.org.
89
* 4. Products derived from this software may not be called "VOCAL", nor
90
* may "VOCAL" appear in their name, without prior written
91
* permission of Vovida Networks, Inc.
93
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
94
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
95
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
96
* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
97
* NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
98
* IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
99
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
100
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
101
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
102
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
103
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
104
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
107
* ====================================================================
109
* This software consists of voluntary contributions made by Vovida
110
* Networks, Inc. and many individuals on behalf of Vovida Networks,
111
* Inc. For more information on Vovida Networks, Inc., please see
112
* <http://www.vovida.org/>.