BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJSIP Reference

#include <siptypes.hpp>

Inheritance diagram for pj::TlsConfig:
pj::PersistentObject

Public Member Functions

 TlsConfig ()
 
pjsip_tls_setting toPj () const
 
void fromPj (const pjsip_tls_setting &prm)
 
virtual void readObject (const ContainerNode &node) throw (Error)
 
virtual void writeObject (ContainerNode &node) const throw (Error)
 
- Public Member Functions inherited from pj::PersistentObject
virtual ~PersistentObject ()
 
virtual void readObject (const ContainerNode &node)=0 throw (Error)
 
virtual void writeObject (ContainerNode &node) const =0 throw (Error)
 

Data Fields

string CaListFile
 
string certFile
 
string privKeyFile
 
string password
 
string CaBuf
 
string certBuf
 
string privKeyBuf
 
pjsip_ssl_method method
 
unsigned proto
 
IntVector ciphers
 
bool verifyServer
 
bool verifyClient
 
bool requireClientCert
 
unsigned msecTimeout
 
pj_qos_type qosType
 
pj_qos_params qosParams
 
bool qosIgnoreError
 

Detailed Description

TLS transport settings, to be specified in TransportConfig.

Constructor & Destructor Documentation

◆ TlsConfig()

pj::TlsConfig::TlsConfig ( )

Default constructor initialises with default values

Member Function Documentation

◆ toPj()

pjsip_tls_setting pj::TlsConfig::toPj ( ) const

Convert to pjsip

◆ fromPj()

void pj::TlsConfig::fromPj ( const pjsip_tls_setting prm)

Convert from pjsip

◆ readObject()

virtual void pj::TlsConfig::readObject ( const ContainerNode node)
throw (Error
)
virtual

Read this object from a container node.

Parameters
nodeContainer to read values from.

Implements pj::PersistentObject.

◆ writeObject()

virtual void pj::TlsConfig::writeObject ( ContainerNode node) const
throw (Error
)
virtual

Write this object to a container node.

Parameters
nodeContainer to write values to.

Implements pj::PersistentObject.

Field Documentation

◆ CaListFile

string pj::TlsConfig::CaListFile

Certificate of Authority (CA) list file.

◆ certFile

string pj::TlsConfig::certFile

Public endpoint certificate file, which will be used as client- side certificate for outgoing TLS connection, and server-side certificate for incoming TLS connection.

◆ privKeyFile

string pj::TlsConfig::privKeyFile

Optional private key of the endpoint certificate to be used.

◆ password

string pj::TlsConfig::password

Password to open private key.

◆ CaBuf

string pj::TlsConfig::CaBuf

Certificate of Authority (CA) buffer. If CaListFile, certFile or privKeyFile are set, this setting will be ignored.

◆ certBuf

string pj::TlsConfig::certBuf

Public endpoint certificate buffer, which will be used as client- side certificate for outgoing TLS connection, and server-side certificate for incoming TLS connection. If CaListFile, certFile or privKeyFile are set, this setting will be ignored.

◆ privKeyBuf

string pj::TlsConfig::privKeyBuf

Optional private key buffer of the endpoint certificate to be used. If CaListFile, certFile or privKeyFile are set, this setting will be ignored.

◆ method

pjsip_ssl_method pj::TlsConfig::method

TLS protocol method from pjsip_ssl_method. In the future, this field might be deprecated in favor of proto field. For now, this field is only applicable only when proto field is set to zero.

Default is PJSIP_SSL_UNSPECIFIED_METHOD (0), which in turn will use PJSIP_SSL_DEFAULT_METHOD, which default value is PJSIP_TLSV1_METHOD.

◆ proto

unsigned pj::TlsConfig::proto

TLS protocol type from pj_ssl_sock_proto. Use this field to enable specific protocol type. Use bitwise OR operation to combine the protocol type.

Default is PJSIP_SSL_DEFAULT_PROTO.

◆ ciphers

IntVector pj::TlsConfig::ciphers

Ciphers and order preference. The Endpoint::utilSslGetAvailableCiphers() can be used to check the available ciphers supported by backend. If the array is empty, then default cipher list of the backend will be used.

◆ verifyServer

bool pj::TlsConfig::verifyServer

Specifies TLS transport behavior on the server TLS certificate verification result:

  • If verifyServer is disabled, TLS transport will just notify the application via pjsip_tp_state_callback with state PJSIP_TP_STATE_CONNECTED regardless TLS verification result.
  • If verifyServer is enabled, TLS transport will be shutdown and application will be notified with state PJSIP_TP_STATE_DISCONNECTED whenever there is any TLS verification error, otherwise PJSIP_TP_STATE_CONNECTED will be notified.

In any cases, application can inspect pjsip_tls_state_info in the callback to see the verification detail.

Default value is false.

◆ verifyClient

bool pj::TlsConfig::verifyClient

Specifies TLS transport behavior on the client TLS certificate verification result:

  • If verifyClient is disabled, TLS transport will just notify the application via pjsip_tp_state_callback with state PJSIP_TP_STATE_CONNECTED regardless TLS verification result.
  • If verifyClient is enabled, TLS transport will be shutdown and application will be notified with state PJSIP_TP_STATE_DISCONNECTED whenever there is any TLS verification error, otherwise PJSIP_TP_STATE_CONNECTED will be notified.

In any cases, application can inspect pjsip_tls_state_info in the callback to see the verification detail.

Default value is PJ_FALSE.

◆ requireClientCert

bool pj::TlsConfig::requireClientCert

When acting as server (incoming TLS connections), reject incoming connection if client doesn't supply a TLS certificate.

This setting corresponds to SSL_VERIFY_FAIL_IF_NO_PEER_CERT flag. Default value is PJ_FALSE.

◆ msecTimeout

unsigned pj::TlsConfig::msecTimeout

TLS negotiation timeout to be applied for both outgoing and incoming connection, in milliseconds. If zero, the SSL negotiation doesn't have a timeout.

Default: zero

◆ qosType

pj_qos_type pj::TlsConfig::qosType

QoS traffic type to be set on this transport. When application wants to apply QoS tagging to the transport, it's preferable to set this field rather than qosParam fields since this is more portable.

Default value is PJ_QOS_TYPE_BEST_EFFORT.

◆ qosParams

pj_qos_params pj::TlsConfig::qosParams

Set the low level QoS parameters to the transport. This is a lower level operation than setting the qosType field and may not be supported on all platforms.

By default all settings in this structure are disabled.

◆ qosIgnoreError

bool pj::TlsConfig::qosIgnoreError

Specify if the transport should ignore any errors when setting the QoS traffic type/parameters.

Default: PJ_TRUE


The documentation for this struct was generated from the following file:
  • siptypes.hpp

 


PJSIP Open Source, high performance, small footprint, and very very portable SIP stack
Copyright (C) 2006-2008 Teluu Inc.