Class SIPTLSChannel
Implements
Inherited Members
Namespace: SIPSorcery.SIP
Assembly: SIPSorcery.dll
Syntax
public class SIPTLSChannel : SIPTCPChannel, IDisposable
Constructors
| Improve this Doc View SourceSIPTLSChannel(IPEndPoint, Boolean, RemoteCertificateValidationCallback)
Declaration
public SIPTLSChannel(IPEndPoint endPoint, bool useDualMode = false, RemoteCertificateValidationCallback remoteCertificateValidation = null)
Parameters
Type | Name | Description |
---|---|---|
System.Net.IPEndPoint | endPoint | |
System.Boolean | useDualMode | |
System.Net.Security.RemoteCertificateValidationCallback | remoteCertificateValidation |
SIPTLSChannel(X509Certificate2, IPAddress, Int32)
Declaration
public SIPTLSChannel(X509Certificate2 serverCertificate, IPAddress listenAddress, int listenPort)
Parameters
Type | Name | Description |
---|---|---|
System.Security.Cryptography.X509Certificates.X509Certificate2 | serverCertificate | |
System.Net.IPAddress | listenAddress | |
System.Int32 | listenPort |
SIPTLSChannel(X509Certificate2, IPEndPoint, Boolean, X509Certificate2Collection, RemoteCertificateValidationCallback)
Declaration
public SIPTLSChannel(X509Certificate2 serverCertificate, IPEndPoint endPoint, bool useDualMode = false, X509Certificate2Collection clientCertificates = null, RemoteCertificateValidationCallback remoteCertificateValidation = null)
Parameters
Type | Name | Description |
---|---|---|
System.Security.Cryptography.X509Certificates.X509Certificate2 | serverCertificate | |
System.Net.IPEndPoint | endPoint | |
System.Boolean | useDualMode | |
System.Security.Cryptography.X509Certificates.X509Certificate2Collection | clientCertificates | |
System.Net.Security.RemoteCertificateValidationCallback | remoteCertificateValidation |
Properties
| Improve this Doc View SourceBypassCertificateValidation
Allows to ignore any ssl policy errors regarding the received certificate. Only applicable when no custom remote certificate validation is provided.
Declaration
public bool BypassCertificateValidation { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ProtDescr
Declaration
protected override string ProtDescr { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Methods
| Improve this Doc View SourceIsProtocolSupported(SIPProtocolsEnum)
Checks whether the specified protocol is supported.
Declaration
public override bool IsProtocolSupported(SIPProtocolsEnum protocol)
Parameters
Type | Name | Description |
---|---|---|
SIPProtocolsEnum | protocol | The protocol to check. |
Returns
Type | Description |
---|---|
System.Boolean | True if supported, false if not. |
Overrides
| Improve this Doc View SourceOnAccept(SIPStreamConnection)
For the TLS channel the SSL stream must be created and any authentication actions undertaken.
Declaration
protected override void OnAccept(SIPStreamConnection streamConnection)
Parameters
Type | Name | Description |
---|---|---|
SIPStreamConnection | streamConnection | The stream connection holding the newly accepted client socket. |
Overrides
| Improve this Doc View SourceOnAcceptAsync(SIPStreamConnection)
For the TLS channel the SSL stream must be created and any authentication actions undertaken.
Declaration
protected async Task OnAcceptAsync(SIPStreamConnection streamConnection)
Parameters
Type | Name | Description |
---|---|---|
SIPStreamConnection | streamConnection | The stream connection holding the newly accepted client socket. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
OnClientConnect(SIPStreamConnection, String)
For the TLS channel once the TCP client socket is connected it needs to be wrapped up in an SSL stream.
Declaration
protected override async Task<SocketError> OnClientConnect(SIPStreamConnection streamConnection, string serverCertificateName)
Parameters
Type | Name | Description |
---|---|---|
SIPStreamConnection | streamConnection | The stream connection holding the newly connected client socket. |
System.String | serverCertificateName | The expected common name on the SSL certificate supplied by the server. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Net.Sockets.SocketError> |
Overrides
| Improve this Doc View SourceSendOnConnected(SIPStreamConnection, Byte[])
Sends data using the connected SSL stream.
Declaration
protected override Task SendOnConnected(SIPStreamConnection sipStreamConn, byte[] buffer)
Parameters
Type | Name | Description |
---|---|---|
SIPStreamConnection | sipStreamConn | The stream connection object that holds the SSL stream. |
System.Byte[] | buffer | The data to send. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |