Contains information about the network streams for a synchronization.
Public Interface NetworkData
public interface NetworkData
All members of NetworkData interface, including all inherited members.
Name | Description |
---|---|
Returns the value of the last header received by the server with the supplied name. | |
Returns all the header values received by the server associated with the supplied name. | |
Returns the existing connection to the MobiLink consolidated database. | |
Returns a dictionary that maps header names to a list of header values. | |
Determines if this synchronization is end-to-end encrypted. | |
Determines if the synchronization uses HTTP or HTTPS. | |
Determines if this synchronization uses TLS. |
This interface is useful when authenticating against another server in the enterprise that uses the client-side certificate and HTTP headers.
To enable a collection of network stream data, add collect_network_data=1 to your -x switches. This option adds additional per-sync memory overhead to store the data. When using TLS or HTTPS, the server asks the client to send a certificate during the TLS handshake, incurring a time and network cost.
You can obtain a NetworkData object by invoking the NetworkData method of the DBConnectionContext interface. When using HTTP or HTTPS, it contains the header data for the last HTTP request received by the server before the authenticate scripts are invoked.
The following example illustrates how to get a NetworkData object from the DBConnectionContext object, and output the data.
using iAnywhere.MobiLink.Script; using System.Collections.Generic; using System.Security.Cryptography.X509Certificates; public class OrderProcessor { DBConnectionContext _cc; public OrderProcessor( DBConnectionContext cc ) { _cc = cc; } public void AuthUser() { NetworkData nd = _cc.NetworkData; if( nd != null ) { if( nd.IsHTTP ) { PrintLn( "http" ); string user_agent = nd.GetHTTPHeaderValue( "user-agent" ); PrintLn( " user-agent: " + user_agent.Substring( 0, user_agent.IndexOf( '/' ) ) ); } else { PrintLn( "no http" ); } if( nd.IsTLS ) { PrintLn( "tls" ); X509Certificate2Collection certs = nd.ClientCertificates; if( certs != null ) { PrintLn( " client-side cert:" ); int n = 1; foreach( X509Certificate2 x509 in certs ) { PrintLn( " cert " + n++ ); PrintLn( " Subject: " + x509.SubjectName.Name ); PrintLn( " Issuer: " + x509.IssuerName.Name ); } } else { PrintLn( " no client cert" ); } } else { PrintLn( "no tls" ); } if( nd.IsEndToEndEncrypted ) { PrintLn( "e2ee" ); } else { PrintLn( "no e2ee" ); } } else { PrintLn( "NULL networkdata" ); } } } |
GetHTTPHeaderValue method
GetHTTPHeaderValues method
ClientCertificates property
HTTPHeaders property
IsEndToEndEncrypted property
IsHTTP property
IsTLS property
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |