AppTunnel Diagnostic API for Xamarin
The AppTunnel Diagnostic API for Xamarin provides troubleshooting information for an app’s use of AppTunnel with HTTP/S tunneling. Typically, you add a user interface, such as a menu item, to invoke a diagnostic run for tunneling to a specified URL. Your app then displays or logs the results of the diagnostic run. The API performs the following diagnostics:
Diagnostic |
Description |
||||||||||||
Run life cycle |
Tests the beginning, ending, and restarting of connections. Redirects restart the connection with a new URL, new cookies, and/or new connection settings. |
||||||||||||
Policy integrity |
Checks that the following elements in the AppTunnel policy that relate to the request are valid:
|
||||||||||||
Certificate challenges |
Evaluates the certificate from the sentry, and uses the client identity to authenticate with the server. If both of these challenges succeed, the API establishes a connection with the sentry. If you start another run while the connection is still established, the new run will not perform any certificate related diagnostics. |
||||||||||||
Connection results |
Presents the data received by the app from the backend server. |
Set up your app to use the AppTunnel Diagnostic API for Xamarin
See AppTunnel Diagnostic API for Xamarin for instructions on setting up your app to use this API.
Run the API
This API is a copy of the native AppTunnel diagnostic API, with the exception that C# nomenclature is used. For details on running this API, please refer to the AppConnect C# binding which provides documentation for each method, property and enumeration in HTML and in Monodoc format.
API Response
The API returns the following series of messages to the console:
Message |
Message Content |
Description |
||||||
1 |
Success: Diagnostic run started. Requesting (URL) Failure: N/A |
Indicates successful start of the API run. |
||||||
2 |
Success: Request matches a tunneling rule so it will be tunneled. Failure:
|
Succeeds if an initial or redirected request matched a tunneling rule, or fails otherwise. |
||||||
3 |
Success: Server certificate in the AppTunnel policy is valid. Failure:
|
Succeeds if the policy contains a valid server certificate, or fails otherwise. |
||||||
4 |
Success: Server certificate passed all evaluation Failure: Server certificate was not trusted. The trust result was (trust result) |
Succeeds if the sentry's server-side certificate is valid, or fails otherwise. |
||||||
5 |
Success: Failure:
|
Returns message if the diagnostic is aborted because the server issued an auth challenge that the diagnostic does not support. Returns no message on success. |
||||||
6 |
Success: Client identity in the AppTunnel policy appears to be valid. Failure:
|
Succeeds if the policy contains a valid client identity, or fails otherwise. |
||||||
7 |
Success: Authenticated with client identity Failure: There was a previous failure of the client auth challenge. |
Succeeds if the client-side certificate was sent, or fails otherwise. |
||||||
8 |
Success: The server redirected to a new URL. Redirected by server to new URL (url) Failure: N/A |
Always succeeds. |
||||||
9 |
Success: Received HTTP status code Failure: Received HTTP status code |
The server returns an HTTP status code. Status codes in the 1xx, 2xx, and 3xx range indicate success. Status codes in the 4xx and 5xx range indicate failure. |
||||||
10 |
Success: Received (bytes) bytes of data Failure: No message appears |
If data is received, the API returns a message. |
||||||
11 |
Success: Session completed normally Failure: Session completed with error: (error) |
Fails if the session completed with an error, or succeeds otherwise. |
Sample response