> For the complete documentation index, see [llms.txt](https://sandbox-docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/readme/system_overview/pg_all_components/pg_prx_users_guide.md).

# ADK-Proxy Programmers Guide

## Preface <a href="#sec_prx_preface" id="sec_prx_preface"></a>

This document contains information on how to use and integrate Cloud Proxy to access the Verifone Cloud.

### Audience <a href="#subsec_prx_audience" id="subsec_prx_audience"></a>

This guide helps application developers to install and utilize the functionality of Cloud Proxy.

### Organization <a href="#subsec_prx_organization" id="subsec_prx_organization"></a>

This guide is organized as follows:

[Chapter 1, Overview](#sec_prx_overview): Provides the introduction and overview for Cloud Proxy.

[Chapter 2, Supported Platforms & System Requirements](#sec_prx_supported_platforms): Shows the OS platforms Cloud Proxy is provided for and specifies prerequisites to the environment.

[Chapter 3, Environments and Download Packages](#sec_prx_cloud_proxy_packages): Description of Cloud Proxy installation packages and packages to activate or add additional cloud environments.

[Chapter 4, Environment Configuration File](#sec_prx_environment_configuration): Description of Cloud Proxy environment configuration file and parameters.

[Chapter 5, Local HTTP Proxy Support](#sec_prx_local_http_proxy_support): Description how to configure a local HTTP proxy

[Chapter 6, Getting Started](#sec_prx_getting_started): How to getting Cloud Proxy started on several platforms.

[Chapter 7, Error Handling](#sec_prx_error_handling): Internal Error messages of Cloud Proxy and its meaning.

[Chapter 8, Troubleshooting](#sec_prx_troubleshooting): Measures for identification and fixing problems.

[Chapter 9, CP Log Forwarder](#sec_prx_cp_log_forwarder): How to setup and configure the CP Log Forwarder.

[Chapter 10, Cloud Proxy Configuration Interface](#sec_prx_configuration_interface): How to use Cloud Proxy Configuration Interface.

Appendix [Version History and Greenbox Migration](#sec_prx_versions_greenbox) provides additional information about Cloud Proxy Version History. Depending on version, Cloud Proxy will migrate to Greenbox (GSC endpoints).

### Related Documentation <a href="#subsec_prx_relateddocs" id="subsec_prx_relateddocs"></a>

To learn more about the ADK framework, please refer to the following documents:

* ADK GUI Programmers Guide
* ADK SYS Programmers Guide
* ADK Communication Service Programmers Guide
* ADK Logging Programmers Guide

## Acronyms Definition <a href="#sec_prx_acronyms" id="sec_prx_acronyms"></a>

|           |                                                                                      |
| --------- | ------------------------------------------------------------------------------------ |
| Acronym   | Definitions                                                                          |
| ADK       | Application Development Kit                                                          |
| API       | Application Programming Interface                                                    |
| DNS       | Domain Name System                                                                   |
| EOF       | End of File                                                                          |
| IPC       | Inter Process Communication                                                          |
| JSON      | JavaScript Object Notation                                                           |
| OS        | Operating System                                                                     |
| SDK       | Software Development Kit                                                             |
| TCP/IP    | Transmission Control Protocol/Internet Protocol                                      |
| VOS       | Verifone Operating System                                                            |
| VOS2      | Verifone Operating System (Version 2)                                                |
| VFI Cloud | Computer network providing online services and applications to Verifone terminals    |
| CP        | Commerce Platform                                                                    |
| CPR       | Commerce Platform Runtime                                                            |
| HTML      | Hypertext Markup Language                                                            |
| CSS       | Cascading Style Sheets                                                               |
| JS        | JavaScript                                                                           |
| MAC       | Multi Application Controller                                                         |
| TLS       | Transport Layer Security                                                             |
| SSL       | Secure Socket Layer                                                                  |
| PK        | Private Key                                                                          |
| CA        | Certificate Authority                                                                |
| URL       | Uniform Resource Locator                                                             |
| PEM       | Privacy Enhanced Mail                                                                |
| base 64   | Binary-to-text encoding schemes that represent binary data in an ASCII string format |
| sysmode   | System mode, administration GUI front-end on Fusion/Engage                           |
| RTT       | Round Trip Time                                                                      |
| CpDev     | CP Development Unit                                                                  |
| OsDev     | OS Development Unit                                                                  |
| ASL       | ADK system launcher                                                                  |
| LAN       | Local area network                                                                   |

## Overview <a href="#sec_prx_overview" id="sec_prx_overview"></a>

With Verifone Commerce Platform Runtime (CPR) a new application type was introduced: **Commerce Platform Applications (CP applications)**.

CP applications are considered as alternative applications formed by HTML/CSS/JS and can run beside native C/C++ applications that are typically in use for payment processing. CP applications usually operate online and they use HTTP requests to communicate with remote services of the VFI Cloud. Due to security reasons, CP applications must not be allowed to open arbitrary connections to external servers. Also direct incoming connections must not be allowed. For this reason, CP applications run in a controlled environment, some kind of sandbox, which is provided by the Multi Application Controller (MAC).

![Cloud Proxy Overview](/files/CoQbpX80CGxYacjgl7pQ)

All connections initiated by CP applications are established and processed in context of MAC, which uses the local loopback device to connect to the Cloud Proxy running on the same terminal. MAC uses HTML based ADK GUI component, which allows CP applications to use JavaScript (JS) interface `xmlHTTPRequest()` for sending and receiving HTTP requests and responses. Cloud Proxy acts as HTTP gateway for CP applications and provides a secure SSL channel to VFI Cloud (TLSv1.2). For establishing the mutual authenticated SSL channel both instances, Cloud Proxy and Server have certificates and private keys required for secure encryption and authentication:

*Cloud Proxy:*

|                         |                                                                                                                                                                                                                               |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Data file               | Description                                                                                                                                                                                                                   |
| Cloud Proxy certificate | Certificate containing the public key of the Cloud Proxy signed by Verifone Certificate Authority (VFI CA). This is used to authenticate the Cloud Proxy on the Cloud Server side.                                            |
| VFI CA certificate      | Certificate of the VFI CA. Cloud Proxy uses this certificate to verify the signature of the Cloud Server certificate to authenticate the Cloud Server.                                                                        |
| PK Cloud Proxy          | Private key of the Cloud Proxy, usually stored in secure area of the terminal. This key corresponds to the public key stored in Cloud Proxy certificate and it is used authenticate the Cloud Proxy on the Cloud Server side. |

*Cloud Server:*

|                          |                                                                                                                                                                                     |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Data file                | Description                                                                                                                                                                         |
| Cloud Server certificate | Certificate containing the public key of the Cloud Server signed by Verifone Certificate Authority (VFI CA). This is used to authenticate the Cloud Server on the Cloud Proxy side. |
| VFI CA certificate       | Certificate of the VFI CA. Cloud Server uses this certificate to verify the signature of the Cloud Proxy certificate to authenticate the Cloud Proxy.                               |
| PK Cloud Server          | Private key of the Cloud Server. This key corresponds to the public key stored in Cloud Server certificate and it is used authenticate the Cloud Server on the Cloud Proxy side.    |

{% hint style="info" %}
Overview illustrates the case that both certificates, Cloud Proxy and Cloud Server certificate, were signed by one common VFI CA.
{% endhint %}

#### **Long-lived TLS connection to Cloud Server**

If a local client (e.g. CP app) sends a HTTP request, Cloud Proxy will establish a new TLS connection, if it has not connected before or the existing connection was closed or is disturbed. After some validation of the HTTP document, Cloud Proxy redirects the message to the Cloud Server. When response from Cloud Server is received, Cloud Proxy keeps the existing TLS channel as long as it is not closed by the server. This will avoid high RTTs for multiple HTTP requests, which would be caused by overhead of the TLS handshake during connection setup. After SSL negotiation, more efficient symmetric ciphers are used, therefore subsequent HTTP requests can be transmitted more faster than single, sporadic requests, which require a reconnect to the server.

{% hint style="info" %}
Since version 2.0.0 Cloud Proxy has implemented SSL sessionID caching according RFC 5246. SSL session resumption eliminates the private key operation when reconnecting to a service and, therefore, dramatically speeds up TLS connection setup.
{% endhint %}

## Supported Platforms & System Requirements <a href="#sec_prx_supported_platforms" id="sec_prx_supported_platforms"></a>

Download packages for Cloud Proxy are available for the following platforms:

* Fusion (VOS) System requirements: Cloud Proxy for VOS requires at least OS version 30250102 or later.
* Engage (VOS2) System requirements: Cloud Proxy for VOS2 requires at least OS version 30350102 or later.
* VOS3 System requirements: Cloud Proxy for VOS3 requires at least OS version VOS3\_0.0.30-CD or later.

## Environments and Download Packages <a href="#sec_prx_cloud_proxy_packages" id="sec_prx_cloud_proxy_packages"></a>

There are several variants and endpoints of Verifone Cloud. Each variant/endpoint represents an environment, which is addressed by its own URL. Implementation and configuration of these environments are different, therefore, users must be aware of using the correct endpoint, which provides required web services for the used CP apps. In addition, these environment endpoints require different authentication settings like certificates to establish secure connection with SSL. For this reason, several download packages are provided to install and activate a specific environment.

Cloud Proxy installs several default environments with the base package (see chapter [Cloud Proxy base packages](#subsec_prx_base_packages)). Users can install an additional activation package on top to activate a specific default environment (see chapter [Default environments and activation](#subsec_prx_default_environments)). In addition, users have to the option to install an User Configuration Package to add own environments if required (see chapter [Install additional environments](#subsec_prx_install_additional_environments)).

{% hint style="info" %}
Since version 3.1.0 of Cloud Proxy, terminals will migrate to new GSC environments of **Verifone Greenbox**. Old default environment endpoints of Verifone Cloud Gateway (CG) can still be used for compatibility reasons, but please note that Cloud Proxy will automatically switch to new GSC endpoints when it is updated. For more details please refer to chapter [Version History and Greenbox Migration](#sec_prx_versions_greenbox). Since version 3.2.0 (and version 3.0.40), Cloud Proxy has added support to add environments with the installation of an User Configuration Package. For more details please refere to chapter [Install additional environments](#subsec_prx_install_additional_environments).
{% endhint %}

### Cloud Proxy base packages <a href="#subsec_prx_base_packages" id="subsec_prx_base_packages"></a>

The following table lists the base download packages to install or uninstall Cloud Proxy:

\[TABLE]

### Default environments and activation <a href="#subsec_prx_default_environments" id="subsec_prx_default_environments"></a>

Each environment is specified by a configuration file having name `<environment>.env`. The content and configuration settings for an environment file are described in chapter [Environment Configuration File](#sec_prx_environment_configuration). Cloud Proxy base package (see [Cloud Proxy base packages](#subsec_prx_base_packages)) installs several default environments, which are listed in the following table:

|                   |                    |                                                                                                              |
| ----------------- | ------------------ | ------------------------------------------------------------------------------------------------------------ |
| Environment name  | Configuration file | Description                                                                                                  |
| **`gsc_dev`**     | `gsc-dev.env`      | Environment settings for GSC Development Cloud \[**(default for CpDev and OsDev units)**]{style="color:red"} |
| **`gsc_qat`**     | `gsc-qat.env`      | Environment settings for GSC Test Cloud                                                                      |
| **`gsc_cst`**     | `gsc-cst.env`      | Environment settings for GSC Staging Cloud                                                                   |
| **`gsc_prod`**    | `gsc-prod.env`     | Environment settings for GSC Productive Cloud \[**(Default for productive units)**]{style="color:red"}       |
| **`gsc_cst_us`**  | `gsc-cst-us.env`   | Environment settings for GSC Staging Cloud **(US region)**                                                   |
| **`gsc_prod_us`** | `gsc-prod-us.env`  | Environment settings for GSC Productive Cloud **(US region)**                                                |

On Fusion (VOS) and Engage (VOS2) the default environment files are located in subfolder `proxy` in working directory of binary `cloudproxy` under `/home/sys13`. On VOS3 platform the user has changed to `sys_prx`, thus, all files of Cloud Proxy are installed under `/home/sys_prx`.

In addition, Cloud Proxy base package installs the following symbolic links pointing to one environment file above:

|                     |                  |                                                |
| ------------------- | ---------------- | ---------------------------------------------- |
| Environment link    | Environment file | Description                                    |
| **`dev.env`**       | `gsc-dev.env`    | Environment settings for GSC Development Cloud |
| **`test.env`**      | `gsc-qat.env`    | Environment settings for GSC Test Cloud        |
| **`statging1.env`** | `gsc-cst.env`    | Environment settings for GSC Staging Cloud     |
| **`prod.env`**      | `gsc-prod.env`   | Environment settings for GSC Productive Cloud  |

{% hint style="info" %}
Symbolic links were introduced for the following since version 3.0.40 and 3.4.0 for the following reasons: 1. Versions 3.0.40 and 3.4.0 were synchronized use the same set of default environment files. Symbolic links are used to resolve file name conflicts in both versions.\
2\. For version 3.0.40 a symlink \<name>.env will point to file old-\<name>.env to take over existing environment, which was used in previous versions < 3.0.40.\
3\. For version 3.4.0 the symlinks will point to new GSC endproints to ensure automatic migration to GSC endpoints (see chapter Version History and Greenbox Migration).
{% endhint %}

With installation of an additional activation package, the user can activate another environment to select another cloud gateway endpoint. Depending on the device type, Cloud Proxy uses a specified environment as default, if it was started for the first time without installed activation package.

{% hint style="info" %}
In addition, since versions 3.0.40 and 3.4.0 different CG and GSC endpoint are used as defaults. Please refer to documentation of corresponding Cloud Proxy version to get more details. Since version 3.5.0 (VOS3 support added), CG endpoints are no longer installed as default environments with the base package. Only versions >=3.0.50 can use it, which is available for VOS/VOS2 only.
{% endhint %}

The following activation packages are provided with this Cloud Proxy release:

|                   |                                  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ----------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Environment       | Description                      | Activation package                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **`gsc_dev`**     | GSC Development Cloud            | <p>VOS/VOS2 platform:<br></p><p><code>dl.cloudproxy-cfg-</code><strong><code>gsc\_dev</code></strong><code>-X.X.X-X-prod.tar</code><br>(system package for productive and CpDev unit)</p><p><code>dl.cloudproxy-cfg-</code><strong><code>gsc\_dev</code></strong><code>-X.X.X-X.tar</code><br>(system package for OsDev unit)</p><p>VOS3 platform:<br></p><p><code>dl.cloudproxy-cfg-</code><strong><code>gsc\_dev</code></strong><code>-X.X.X-X.tar</code><br>(sys\_prx package for OsDev unit only. Requires new signing for other device types!)</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Note</p><p>\[These download packages <strong>cannot be used for productive units</strong>, since the environment gateway has not installed productive AuthEX CA! If installed on a productive unit, Cloud Proxy will ignore this configuration and fallback to default environment <strong><code>gsc\_prod</code></strong>. ]{style="color:red"}</p></div> |
| **`gsc_qat`**     | GSC Test Cloud                   | <p>VOS/VOS2 platform:<br></p><p><code>dl.cloudproxy-cfg-</code><strong><code>gsc\_qat</code></strong><code>-X.X.X-X-prod.tar</code><br>(sys13 package for productive and CpDev unit)</p><p><code>dl.cloudproxy-cfg-</code><strong><code>gsc\_qat</code></strong><code>-X.X.X-X.tar</code><br>(sys13 package for OsDev unit)</p><p>VOS3 platform:<br></p><p><code>dl.cloudproxy-cfg-</code><strong><code>gsc\_qat</code></strong><code>-X.X.X-X.tar</code><br>(sys\_prx package for OsDev unit only. Requires new signing for other device types!)</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Note</p><p>\[These download packages are allowed to be used for both, productive and test units!]{style="color:red"}</p></div>                                                                                                                                                                                                                               |
| **`gsc_cst`**     | GSC Staging Cloud                | <p>VOS/VOS2 platform:<br></p><p><code>dl.cloudproxy-cfg-</code><strong><code>gsc\_cst</code></strong><code>-X.X.X-X-prod.tar</code><br>(sys13 package for productive and CpDev unit)</p><p><code>dl.cloudproxy-cfg-</code><strong><code>gsc\_cst</code></strong><code>-X.X.X-X.tar</code><br>(sys13 package for OsDev unit)</p><p>VOS3 platform:<br></p><p><code>dl.cloudproxy-cfg-</code><strong><code>gsc\_cst</code></strong><code>-X.X.X-X.tar</code><br>(sys\_prx package for OsDev unit only. Requires new signing for other device types!)</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Note</p><p>\[These download packages are allowed to be used for both, productive and test units!]{style="color:red"}</p></div>                                                                                                                                                                                                                               |
| **`gsc_prod`**    | GSC Productive Cloud             | <p>VOS/VOS2 platform:<br></p><p><code>dl.cloudproxy-cfg-</code><strong><code>gsc\_prod</code></strong><code>-X.X.X-X-prod.tar</code><br>(sys13 package for productive unit)</p><p>VOS3 platform:<br></p><p><code>dl.cloudproxy-cfg-</code><strong><code>gsc\_prod</code></strong><code>-X.X.X-X.tar</code><br>(sys\_prx package for OsDev unit only. Requires new signing for other device types!)</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Note</p><p>\[These download packages are allowed to be used on <strong>productive units only</strong>! If installed on a test unit (CpDev or OsDev), Cloud Proxy will ignore this configuration and fallback to default environment <strong><code>gsc\_dev</code></strong>.]{style="color:red"}</p></div>                                                                                                                                                                                                   |
| **`gsc_cst_us`**  | GSC Staging Cloud (US region)    | <p>VOS/VOS2 platform:<br></p><p><code>dl.cloudproxy-cfg-</code><strong><code>gsc\_cst\_us</code></strong><code>-X.X.X-X-prod.tar</code><br>(sys13 package for productive and CpDev unit)</p><p><code>dl.cloudproxy-cfg-</code><strong><code>gsc\_cst\_us</code></strong><code>-X.X.X-X.tar</code><br>(sys13 package for OsDev unit)</p><p>VOS3 platform:<br></p><p><code>dl.cloudproxy-cfg-</code><strong><code>gsc\_cst\_us</code></strong><code>-X.X.X-X.tar</code><br>(sys\_prx package for OsDev unit only. Requires new signing for other device types!)</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Note</p><p>\[These download packages are allowed to be used for both, productive and test units!]{style="color:red"}</p></div>                                                                                                                                                                                                                   |
| **`gsc_prod_us`** | GSC Productive Cloud (US region) | <p>VOS/VOS2 platform:<br></p><p><code>dl.cloudproxy-cfg-</code><strong><code>gsc\_prod\_us</code></strong><code>-X.X.X-X-prod.tar</code><br>(sys13 package for productive unit)</p><p>VOS3 platform:<br></p><p><code>dl.cloudproxy-cfg-</code><strong><code>gsc\_prod\_us</code></strong><code>-X.X.X-X.tar</code><br>(sys\_prx package for OsDev unit only. Requires new signing for other device types!)</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Note</p><p>\[These download packages are allowed to be used on <strong>productive units only</strong>! If installed on a test unit (CpDev or OsDev), Cloud Proxy will ignore this configuration and fallback to default environment <strong><code>gsc\_dev</code></strong>.]{style="color:red"}</p></div>                                                                                                                                                                                           |

### Install additional environments <a href="#subsec_prx_install_additional_environments" id="subsec_prx_install_additional_environments"></a>

Since version 3.2.0 (and version 3.0.40), Cloud Proxy has added support to install User Configuration Packages to add additional environments with required SSL certificates. User Configuration Packages are provided by the Cloud Proxy end users (application or integration team), thus, these packages can be signed having sponsor signing previleges (e.g. with regional singing cards for VOS/VOS2).

{% hint style="info" %}
Cloud Proxy uses the same configuration files for different platforms. Please note that VOS3 platform uses a different package format and location on target. Therefore, the following chapters will show the differences for each supported platform.
{% endhint %}

#### VOS/VOS2 User Configuration Packages <a href="#subsubsec_prx_user_config_vos_vos2" id="subsubsec_prx_user_config_vos_vos2"></a>

Basically, Cloud Proxy User Configuration Packages for VOS/VOS2 are installed to following read-only device location:

```fragment
/etc/config
```

User Configuration Packages for Cloud Proxy must use subfolder `proxy` so that the related files will be located on the devices at follows:

```fragment
/etc/config/proxy
```

User Configuration Packages may contain the following data:

1. Bundle with arbitrary name (user: `usr1-usr16`):
   * Package with arbitrary name (user: `usr1-usr16`, group: `share`, type: `config`):

     |                     |                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
     | ------------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
     | Destination         | File                | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
     | `/etc/config/proxy` | `<environment>.env` | <p>Environment configuration file as specified in chapter <a href="#sec_prx_environment_configuration">Environment Configuration File</a>.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Note</p><p>Flag <code>activate</code> in section <code>cloud</code> in the configuration file can be used to activate the environment with the next startup of Cloud Proxy (after the User Configuration Package is installed).</p></div><p>The filename <code>\<environment>.env</code> must differ to default environment files as installed with the Cloud Proxy base package (see chapter <a href="#subsec_prx_default_environments">Default environments and activation</a>). If a name conflicts, the environment file <code>\<environment>.env</code> of the User Configuration Package is ignored.</p> |
     | `/etc/config/proxy` | `*.pem, *.p12`      | Additional certificates/key files, which are referred by the environment file `<environment>.env`. For more details refer to descritiption of `ca-file` and `client-id` in chapter [Environment Configuration File](#sec_prx_environment_configuration).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

{% hint style="info" %}
For more details how to create such an User [Config](/adk-5.0-programmers-guide/readme/annotated/class_config.md) Package, please refer to user guide Verifone Secure Installer ERS.
{% endhint %}

#### VOS3 User Configuration Packages <a href="#subsubsec_prx_user_config_vos3" id="subsubsec_prx_user_config_vos3"></a>

Cloud Proxy user configuration is read-only and shall be installed with user previleges (signer `SPONSOR`). VOS3 system typically installs read-only user files with package type `user_ro`, which means that the files will be placed to home directory for user `usr1`-`usr16`:

```fragment
/home/usr<X>
```

Since other application files are located there, User configuration Packages for Cloud Proxy must use subfolder `proxy` to separate them from application:

```fragment
/home/usr<X>/proxy
```

Additional group permissions must be set for the package so that Cloud Proxy is able to access and lookup the files.

At startup Cloud Proxy checks for the existence of the folder with included files starting from `usr1` up to `usr16`. If there are related files found under a specific user, this user directory is applied as source for user configuration files. This means, the first user providing the files wins, other users with higher user numbers will be ignored.

User Configuration Packages may contain the following data:

1. Bundle with arbitrary name (user: `usr1-usr16`):
   * Package with arbitrary name (user: `usr1-usr16`, group: `usr1sys`, type: `user_ro`):

     |                      |                     |                                                                                                                                                           |
     | -------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
     | Destination          | File                | Description                                                                                                                                               |
     | `/home/usr<X>/proxy` | `<environment>.env` | Same as for VOS/VOS2 platform, for description please refer to chapter [VOS/VOS2 User Configuration Packages](#subsubsec_prx_user_config_vos_vos2) above. |
     | `/home/usr<X>/proxy` | `*.pem, *.p12`      | Same as for VOS/VOS2 platform, for description please refer to chapter [VOS/VOS2 User Configuration Packages](#subsubsec_prx_user_config_vos_vos2) above. |

A sample User Configuration Package for the corresponding platform comes along in subfolder `example/load/usr_config` of documentation package `prx-doc-X.X.X-X.zip`:

* **dl.prx-usrconfig-sample-env-X.X.X-X.tar** This package installs a sample environment file `sample.env` with a root CA certificate `mycloud-ca.pem`. The certificate is refered by `ca-file` in the environment file, which is used to autenticate the server for cloud endpoint `url`.
* **dl.prx-usrconfig-old-cg-envs-X.X.X-X.tar** This package installs old CG environments (`dev`, `test`, `staging1` and `prod`) for `verifone.cgateway.com`. Please note that these environments are \[deprecated]{style="color:red"} and shouldn't longer be used productive environments. Users should migrate to the new GSC environments soon, since old CG environment endpoints will go offline sooner or later. For more details please refer to chapter [Version History and Greenbox Migration](#sec_prx_versions_greenbox).

## Environment Configuration File <a href="#sec_prx_environment_configuration" id="sec_prx_environment_configuration"></a>

This chapter describes the content and settings of an environment configuration file. Several default environments come along with installation of Cloud Proxy base package (see chapter [Cloud Proxy base packages](#subsec_prx_base_packages)), which can be activated with additional packages installed on top of the base installation. In addition, users have the option to install additional environments with a User Configuration Package (see chapter [Install additional environments](#subsec_prx_install_additional_environments)).

The configuration file for the active environment is read at startup of Cloud Proxy and contains the following settings:

(Example configuration file: `gsc_qat` environment in file `test.env`)

```fragment
[cloud]
; URL of the VFI-Cloud environment, e.g. vfi-cloud.verifone.com:8843, URL is mandatory, default port: 8843
url=qat2.test-gsc.vfims.com:443
; name of the environment (alias). This is used as 'environment name' with the Cloud Proxy Configuration Interface
; (see parameters cloud_env_list and cloud_env_list2). If not set, the environment filename is used without
; extension *.env. Please note that alias must be identical crossover environment configuration files and also not
; conflict with other environment filenames, if these files don't use an alias.
alias=gsc_qat
; productive environment, set to value 'true', if this environment uses productive AuthEx CA, which can be used by productive units only.
; Value 'false' implies that only cp-dev and os-dev devices can use this environment having DEV AuthEx CA (default: false).
; Please note variable 'allow_prod_unit', which allows productive units to use non-prod environment with AuthEx!
prod=false
allow_prod_unit=true
; activate this environment after it is installed with user config package, default: false
; activate=false -> default configuration coming along with Cloud Proxy base package
; name of the file containing the root CA certificate of VFI cloud, default=cloud-ca.pem
; Note: In case of using 'new-ca-file', 'ca-file' contains 2 CA root certificates, which
; are used during transition phase to migrate VFI cloud to a new CA (CA update):
; 1. CA certificate: for VFI cloud with the current CA to be replaced (before the CA update)
; 2. CA certificate: for VFI cloud with the new CA (after the CA update)
ca-file=cloud-ca.pem
; name of the file containing the new root CA certificate of VFI cloud after a pending
; CA update, default=empty
; Note: This certificate must equal the new 2. CA certificate specified in file 'ca-file',
;       since Cloud Proxy switches from 'ca-file' to 'new-ca-file', after it has connected
;       to the updated VFI cloud for the first time. From this point, Cloud Proxy will not
;       be able to connect to VFI cloud using the old CA.
; new-ca-file=new-cloud-ca.pem

[proxy]
; filename of the PEM or PKCS12 file containing an alternative client certificate/private key.
; This is used, if device hasn't installed AuthEx certificate/key or AuthEx was disabled Cloud Proxy Configuration Interface.
; default: empty (force usage of AuthEx certifcate/key if installed)
; client-id=
; label string used by cloudproxy for the client certificate (if empty 'client-id' w/o file extension is used)
; client-id-label=
; client timeout in sec when waiting for replies from the cloud, default=30sec
timeout=30
; listen port number for incoming connections from the clients, default=8888
port=8888

[logservice]
; URL of the log gateway (usually a relative path)
url=/cp
; host as destination for the logs (host used for routing the logs)
host=logging-service.verifone.com
; initial log level used for CP app logging, default=5
loglevel=7

[connectivity]
; URL of the availability service (usually a relative path)
url=/DeviceConnectivity/Check
; availability service host
host=gsc
```

Description of settings in configuration file `<environment>.env`:

\[TABLE]

## Local HTTP Proxy Support <a href="#sec_prx_local_http_proxy_support" id="sec_prx_local_http_proxy_support"></a>

Since version 3.4.0 (and version 3.0.40), Cloud Proxy has added support to establish Cloud connections over a HTTP proxy. This HTTP proxy usually is available in LAN and provides HTTP clients access to outer world. Instead of connecting to Cloud endpoint directly (which is specified by [Environment Configuration File](#sec_prx_environment_configuration)), Cloud Proxy first establishes the TCP/IP connection to this local HTTP proxy. As second step it sends a HTTP CONNECT request to this proxy to establish a transparent TCP/IP channel to the Cloud endpoint. Finally, Cloud Proxy does the TLS handshake over this spliced channel to establish a secure end-to-end TLS connection to the Cloud endpoint.

The activation of a local HTTP proxy is done by configuration file `httpproxy.cfg`. The file may contain multiple sections to configure a HTTP proxy for one or more specific Cloud environments.

```fragment
; productive environment gsc_prod uses this proxy (specified by prod.env)
[gsc_prod]
proxy=192.168.188.250:8888
attribute_1=Proxy-Authorization: Basic YW5kcmU6ZHJvd3NzYXA=
attribute_2=X-VFI-TEST: Some proxy data
attribute_3=X-VFI-TEST2: More proxy data

; pseudo environment name 'default' is used to configure a default HTTP proxy
[default]
proxy=192.168.188.250:8080
attribute_1=X-VFI-TEST: Some proxy data
attribute_2=X-VFI-TEST2: More proxy data
```

The section name represents the environment name, which is either the environment alias specified in (see [Environment Configuration File](#sec_prx_environment_configuration)) or the basename of environment configuration file w/o extension, in case no alias is used.

{% hint style="info" %}
Default environment configurations provided with Cloud Proxy base package use aliases, which are listed in table of chapter [Default environments and activation](#subsec_prx_default_environments) as environment name. Thus, user must specify the section by these names to match an environment, e.g. `gsc_prod` is used for environment file `gsc-prod.env`.
{% endhint %}

Pseudo environment name `default` represents the default HTTP proxy, which is used, if the name of the active environment does not match any other section. Section `default` can be used as one and only section, if only one proxy shall be used for all environments. If section `default` is omitted and no corresponding section matches to the name of the active environment, no local HTTP proxy will be used.

{% hint style="info" %}
If additional environments are installed by User Configuration Package (see chapter [Install additional environments](#subsec_prx_install_additional_environments)), users should avoid to use `default` as environment name. In this case section `default` would be applied for this environment only.
{% endhint %}

Description of section parameters in configuration file `httproxy.cfg`:

|                      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Parameter            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `proxy`              | <p>URL of the HTTP proxy, which specifies a host name or IP address (with a port). Both parameters are separated by ':'. If no port is specified, port <code>8888</code> is used as default.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Note</p><p>Please note that parameter <code>proxy</code> is mandatory and section skipped, if it misses mandatory data or contains an invalid format.</p><p>IPv6 IP address are bracketed with <code>\[]</code>, example: <code>proxy=\[::1]:12345</code>.</p></div> |
| `attribute_<number>` | <p>HTTP header attribute(s) added to HTTP CONNECT request, which is sent to HTTP proxy to establish the TCP/IP channel. Attribute <code>\<number></code> starts with 1, numbers of following attributes must have ascending order.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Note</p><p>Attributes for HTTP CONNECT might be required, if the HTTP proxy requires authentication with <code>Proxy-Authorization</code>.</p></div>                                                                           |

HTTP proxy configuration file `httpproxy.cfg` is installed with an User Configuration Package. User Configuration Packages are provided by the Cloud Proxy end users (application or integration team), thus, these packages can be signed having sponsor signing previleges (e.g. with regional singing cards for VOS/VOS2).

{% hint style="info" %}
Cloud Proxy uses the same configuration files for different platforms. Please note that VOS3 platform uses a different package format and location on target. Therefore, the following chapters will show the differences for each supported platform.
{% endhint %}

### VOS/VOS2 User Configuration Packages <a href="#subsec_prx_local_proxy_user_config_vos_vos2" id="subsec_prx_local_proxy_user_config_vos_vos2"></a>

A VOS/VOS2 User Configuration Package is installed to `/etc/config`, whereas Cloud Proxy uses subfolder `/etc/config/proxy` (see also chapter [Install additional environments](#subsec_prx_install_additional_environments)).

An User Configuration Package to active/configure a HTTP proxy may contain the following data:

1. Bundle with arbitrary name (user: `usr1-usr16`):
   * Package with arbitrary name (user: `usr1-usr16`, group: `share`, type: `config`):

     |                     |                 |                                                                                                                                                           |
     | ------------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
     | Destination         | File            | Description                                                                                                                                               |
     | `/etc/config/proxy` | `httpproxy.cfg` | HTTP proxy configuration file with content specified above. With restart of Cloud Proxy, the configuration will be read and applied for the environments. |

### VOS3 User Configuration Packages <a href="#subsec_prx_local_proxy_user_config_vos3" id="subsec_prx_local_proxy_user_config_vos3"></a>

User Configuration Packages for VOS3 are installed to user home directory `/home/usr<X>`, whereas Cloud Proxy uses subfolder `/home/usr<X>/proxy` (see also chapter [Install additional environments](#subsec_prx_install_additional_environments)).

A VOS3 User Configuration Package to active/configure a HTTP proxy may contain the following data:

1. Bundle with arbitrary name (user: `usr1-usr16`):
   * Package with arbitrary name (user: `usr1-usr16`, group: `usr1sys`, type: `user_ro`):

     |                      |                 |                                                                                                                                                              |
     | -------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
     | Destination          | File            | Description                                                                                                                                                  |
     | `/home/usr<X>/proxy` | `httpproxy.cfg` | Same as for VOS/VOS2 platform, for description please refer to chapter [VOS/VOS2 User Configuration Packages](#subsec_prx_local_proxy_user_config_vos_vos2). |

A sample User Configuration Package for the corresponding platform comes along in subfolder `example/load/usr_config` of documentation package `prx-doc-X.X.X-X.zip`:

* **dl.prx-usrconfig-sample-proxy-X.X.X-X.tar** This package installs a sample configuration file `httpproxy.cfg` for using one HTTP proxy `192.168.188.34:8888` for all environments:

  ```fragment
  ; all environments use 'default' proxy
  [default]
  proxy=192.168.188.34:8888
  attribute_1=Proxy-Authorization: Basic YW5kcmU6ZHJvd3NzYXA=
  attribute_2=X-VFI-TEST: Hello
  attribute_3=X-VFI-TEST2: World
  ```

## Getting Started <a href="#sec_prx_getting_started" id="sec_prx_getting_started"></a>

Depending on platform do the following steps to install Cloud Proxy:

* VOS/VOS2 platform:
  * Get latest load distribution package `prx-vos-load-X.X.X-X.zip` or `prx-vos2-load-X.X.X-X.zip` from Artifactory and extract it. Alternatively download full package `prx-full-X.X.X-X.zip` containing packages for all platforms.
  * On terminal enter sysmode (system mode) and put terminal into Netloader download mode
  * On PC start MX9 Downloader tool and download the base package `dl.cloudproxy-X.X.X-X.tar` (see chapter [Cloud Proxy base packages](#subsec_prx_base_packages))
  * After installation of the package in home directory of user `sys13`, the terminal reboots and cloudproxy service is automatically launched by launched by MAC. Please note that cloudproxy get launched only, if at least one CPApp is installed.
  * If required, user can install an additional activation package to enable a specific default environment (see chapter [Default environments and activation](#subsec_prx_default_environments)). For this, just repeat the steps above with the corresponding activation package.
* VOS3 platform:

  * Get latest load distribution package `prx-vos3-load-X.X.X-X.zip` from Artifactory and extract it. Alternatively download full package `prx-full-X.X.X-X.zip` containing packages for all platforms.
  * On terminal enter Software Control Panel (provided with MAC) and select button "Download Netloader" to put terminal into Netloader download mode
  * On PC start MX9 Downloader tool and download the base package `dl.cloudproxy-X.X.X-X.tar` (see chapter [Cloud Proxy base packages](#subsec_prx_base_packages))
  * After installation of the package in home directory of user `sys_prx`, the terminal reboots and cloudproxy service is automatically launched by MAC. Please note that cloudproxy get launched only, if at least one CPApp is installed.
  * If required, user can install an additional activation package to enable a specific default environment (see chapter [Default environments and activation](#subsec_prx_default_environments)). For this, just repeat the steps above with the corresponding activation package.

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Please note that Cloud Proxy binary depends on ADK libraries <code>libvfiipc</code> and <code>liblog</code>. Instructions for installation on the corresponding platform can be found in documentations of <em>ADKIPC</em> and <em>ADKLOG</em> projects.</p></div>

## Error Handling <a href="#sec_prx_error_handling" id="sec_prx_error_handling"></a>

After Cloud Proxy has accepted a new client connection to process a HTTP request, there might occur several errors for a variety of reasons. Behaviour and actions of Cloud Proxy in this error situations depend on phase of the live circle of the HTTP request. The following table lists the session states of Cloud Proxy in which HTTP request is processed and the possible errors, which will lead to the resulting actions:

\[TABLE]

## Troubleshooting <a href="#sec_prx_troubleshooting" id="sec_prx_troubleshooting"></a>

On all platforms logging messages can be enabled by setting environment variable `PRX_LOGMASK`. This variable is defined as a bitmask consisting of following decimal values:

```cpp
1 = LOG_EMERG: log messages for conditions, if system is unusable
2 = LOG_ALERT: log messages, which action must be taken immediately
4 = LOG_CRIT: log messages for critical conditions
8 = LOG_ERR: log messages for error conditions
16 = LOG_WARNING: log messages for warning conditions
32 = LOG_NOTICE: log messages for normal but significant conditions
64 = LOG_INFO: log messages with informational contents
128 = LOG_DEBUG: log debug-level messages
```

Default value for `PRX_LOGMASK` is `0`, which means that no logging outputs are activated by default. `LOG_EMERG` represents the lowest logging level, which only generates messages, if Cloud Proxy cannot be started or is not working at all. The highest level `LOG_DEBUG` will produce many messages of low-level I/O routines and should only be enabled for debugging purposes. For first analyses it is recommended to set `LOG_ERR`, which will provide information about error conditions, e.g. communication problems.

A console logging message consist of the following fields:

![](/files/AG63Dz3xlsLXy8OGpDiX)

1\) *timestamp:* The timestamp format is `<seconds>`.`<milliseconds>`. The value represents the time since beginning of capture (startup or first usage of IPC component).

2\) *log* *prefix*, *log* *channel:* The field `log` `prefix` is used to identify Cloud Proxy as logging source. For identification of the subcomponent the field `log` `channel` was introduced. Recently this is always `PRX`, but other names can be used for future extensions.

{% hint style="info" %}
On Fusion (VOS), Engage (VOS2) and VOS3 Cloud Proxy is running as system process and environment variables can be set with intallation package only. Due to the fact that system packages require additional privileges to modify and resign them, users should prefer ADKLOG logging mechanism for these platforms, which is descriped below.
{% endhint %}

**Support for ADKLOG: Logging with liblog library**

Since version 2.0.1 the Cloud Proxy also has added support for ADKLOG component. ADKLOG is required to implement the new ADK logging concept, which provides the Logging Control Panel (LCP) used as central instance to configure and enable logging for the several ADK components. For this, LCP uses a configuration files (recently one for Cloud Proxy), which are read by `liblog` library. If installed on the system, `liblog` library will be used by Cloud Proxy to output logging messages. In this case, the logging messages are passed to `liblog` library instead of using console logging mechanism (with stderr), which is described above.

In order to lookup the corresponding configuration files, ADKLOG uses component identifiers, which are reserved for each ADK component. Cloud Proxy uses the following:

|              |                    |                                  |
| ------------ | ------------------ | -------------------------------- |
| Component Id | Configuration file | Description                      |
| `PRX`        | `PRX_log.conf`     | Cloud Proxy related log settings |

The configuration files contain several settings for logging like output channels, verbosity and a logging mask, which is similar to environment variable `PRX_LOGMASK`. For more details about configuration settings or logging message formats, please refer to documentation of ADKLOG project.

{% hint style="info" %}
If environment variable `PRX_LOGMASK` is set, console logging is preferred and ADKLOG with `liblog` is disabled. Only if the environment variable is unset, Cloud Proxy will lookup `liblog` library from the system to enable logging via ADKLOG.
{% endhint %}

## CP Log Forwarder <a href="#sec_prx_cp_log_forwarder" id="sec_prx_cp_log_forwarder"></a>

CP applications may generate logging messages, which needs to be transmitted to *Verifone CP Logging Service*. This service is coupled to the VFI Cloud server and the basic usage is to provide an interface to CP apps for statistics and error reporting. Without the need initially of a sensitive data logging filter the messages must be transferred in a secure way. Therefore, Cloud Proxy has implemented a CP Log Forwarder, which redirects messages to the *Verifone CP Logging Service* over the secure SSL channel to VFI Cloud. The CP Log Forwarder receives logging data from CP apps with notification `_CPLog` over interface of *ADKIPC* component. No result notification is returned to CP applications by the CP Log Forwarder. Content and format of Log HTTP messages are described in *CPR* documentation. For details about notification interface, please refer to *ADKIPC* documentation and the programmers guide.

CP Log Forwarder is configured in environment configuration file `<environment>.env` (see chapter [Environment Configuration File](#sec_prx_environment_configuration)).

## Cloud Proxy Configuration Interface <a href="#sec_prx_configuration_interface" id="sec_prx_configuration_interface"></a>

Since version 3.0.0 of Cloud Proxy, applications are allowed to use the remote configuration interface to read out information and settings of Cloud Proxy. Recently, the interface is fully implemented by CPDownloader application, which comes along with ADKGUI component. CPDownloader allows to show information like installed Cloud Proxy version or which environment or certificates are being used. In addition, a small amount of settings can be configured into Cloud Proxy, for instance, it is possible to switch the cloud environment during runtime. This chapter provides an overview about the Cloud Proxy Configuration Interface and instructions for applications that want to implement the interface instead of using CPDownloader.

Cloud Proxy Configuration Interface is provided via notification service of *ADKIPC* component. An application can send configuration requests as IPC notification with notification `CloudProxyConf`. After Cloud Proxy has processed the request, it responds with notification `CloudProxyConfResponse`. Both, configuration request and responses have a JSON encoded payload and use a JSON object `proxy` as container, which contains all data. An overview about the supported commands and its parameters is given by the following chapters.

{% hint style="info" %}
Please note that an application must initialize IPC notification service with a unique application ID. For more details please refer to *ADKIPC* documentation and the programmers guide.
{% endhint %}

### Read Static Information <a href="#subsec_prx_read_information" id="subsec_prx_read_information"></a>

Static information parameters like version and build details can be requested with command `info`. Static information parameters won't change until next reboot.

`CloudProxyConf` parameters:

|           |           |         |
| --------- | --------- | ------- |
| Container | Parameter | Content |
| `proxy`   | `command` | `info`  |

Example:

```cpp
{
  "proxy" : {
   "command" : "info"
  }
}
```

`CloudProxyConfResponse` parameters:

|           |                   |                                                                                                                                                                          |
| --------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Container | Parameter         | Content                                                                                                                                                                  |
| `proxy`   | `auth_ex_support` | <p>AuthEx key/certificate for SSL client authentication is installed and supported by the system:<br><code>1</code>=supported<br><code>0</code>=unsupported</p>          |
| `proxy`   | `buildinfo`       | <p>Build information string of format:<br><code>\<name> \<version> \<month> \<day> \<year> \<hour>:\<min>:\<sec></code></p>                                              |
| `proxy`   | `device_type`     | <p>Detected device type string:<br><code>prod</code>=productive unit<br><code>os-dev</code>=Fusion/Engage OsDev unit<br><code>cp-dev</code>=Fusion/Engage CpDev unit</p> |
| `proxy`   | `version`         | <p>Version string in format:<br><code>\<major number>.\<minor number>.\<bugfix number>-\<build number></code></p>                                                        |
| `proxy`   | `result`          | <p>Result:<br><code>success</code>=command successful<br><code>error</code>=command failed</p>                                                                           |

Example:

```cpp
{
  "proxy" : {
   "auth_ex_support" : 0,
   "buildinfo" : "cloudproxy 3.0.0-1 Mar 14 2018 12:16:56",
   "device_type" : "prod",
   "version" : "3.0.0-1",
   "result" : "success"
  }
}
```

### Read Configuration <a href="#subsec_prx_read_config" id="subsec_prx_read_config"></a>

Configuration settings can be read with command `readconfig`.

`CloudProxyConf` parameters:

|           |           |              |
| --------- | --------- | ------------ |
| Container | Parameter | Content      |
| `proxy`   | `command` | `readconfig` |

Example:

```cpp
{
  "proxy" : {
   "command" : "readconfig"
  }
}
```

`CloudProxyConfResponse` parameters:

\[TABLE]

Example:

```cpp
{
  "proxy" : {
   "auth_ex" : 1,
   "cloud_env" : "dev",
   "cloud_env_file" : "proxy/dev.env",
   "cloud_env_list" : ["prod", "dev", "test", "staging1"],
   "cloud_env_list2" : [
   {"name":"prod",
   "prod":true,
   "certs":["auth-ex"]
   },
   {"name":"dev",
   "prod":false,
   "certs":["auth-ex"]
   },
   {"name":"test",
   "prod":false,
   "certs":["auth-ex"]
   },
   {"name":"staging1",
   "prod":false,
   "certs":["auth-ex"]
   }
   ],
   "cloud_hostname" : "dev.cgateway.verifone.com",
   "result" : "success"
  }
}
```

### Write Configuration <a href="#subsec_prx_write_config" id="subsec_prx_write_config"></a>

Configuration settings can be written with command `writeconfig`.

`CloudProxyConf` parameters:

|           |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| --------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Container | Parameter   | Content                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `proxy`   | `command`   | `writeconfig`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `proxy`   | `cloud_env` | <p>Name of cloud environment to be enabled, a string of environment list provided with parameter <code>cloud\_env\_list</code> in command <code>readconfig</code> (see above).</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Note</p><p>Test units (CpDev and OsDev) does not allow to enable environment <code>prod</code> and in this case command <code>writeconfig</code> will fail on these devices.</p></div>                                                                                                                                                                                                                                                                                                                                                                                                                |
| `proxy`   | `auth_ex`   | <p>If installed and supported, AuthEx certificate for SSL client authentication can be enabled or disabled:<br><code>1</code>=enable<br><code>0</code>=disable</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Note</p><p>It is not allowed to disable AuthEx certificate for an environment, which does not provide an alternative certificate in certificate list different than string <code>auth-ex</code> (see parameter <code>certs</code> in environment list <code>cloud\_env\_list2</code>).<br>In addition, AuthEx certificate cannot be enabled, if it is not installed or supported by the system (see chapters <a href="#subsec_prx_read_information">Read Static Information</a> and <a href="#subsec_prx_read_config">Read Configuration</a>).<br>In both cases command <code>writeconfig</code> will fail.</p></div> |

Example:

```cpp
{
  "proxy" : {
   "command" : "writeconfig",
   "cloud_env" : "dev",
   "auth_ex" : 0
  }
}
```

`CloudProxyConfResponse` parameters:

|           |           |                                                                                                |
| --------- | --------- | ---------------------------------------------------------------------------------------------- |
| Container | Parameter | Content                                                                                        |
| `proxy`   | `result`  | <p>Result:<br><code>success</code>=command successful<br><code>error</code>=command failed</p> |

Example:

```cpp
{
  "proxy" : {
   "result" : "success"
  }
}
```

### Cloud Connectivity Check <a href="#subsec_prx_connectivity_check" id="subsec_prx_connectivity_check"></a>

Applications can use command `cloudcheck` to check the connectivity to VFI Cloud gateway. With this command Cloud Proxy will establish a secure SSL connection to VFI Cloud gateway, which will forward the request to *Verifone Connectivity Service* webserver, which is behind the VFI Cloud gateway. URL and host of the *Verifone Connectivity Service* webserver is configured in environment configuration file `<environment>.env` (see chapter [Environment Configuration File](#sec_prx_environment_configuration)).

`CloudProxyConf` parameters:

|           |           |              |
| --------- | --------- | ------------ |
| Container | Parameter | Content      |
| `proxy`   | `command` | `cloudcheck` |

Example:

```cpp
{
  "proxy" : {
   "command" : "cloudcheck"
  }
}
```

`CloudProxyConfResponse` parameters:

|           |                |                                                                                                                                                                                                                                                                                                                                  |
| --------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Container | Parameter      | Content                                                                                                                                                                                                                                                                                                                          |
| `proxy`   | `error_code`   | <p>HTTP status code of Connectivity Check request, examples:</p><p><code>200</code> (OK)</p><p><code>503</code> (Service Unavailable)</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Note</p><p>Status codes <code>2xx</code> are returned for success, others mean failure.</p></div> |
| `proxy`   | `error_reason` | <p>Result as string (readable error reason), examples:</p><p><code>OK</code></p><p><code>Service Unavailable</code></p>                                                                                                                                                                                                          |
| `proxy`   | `result`       | <p>Result:<br><code>success</code>=command successful<br><code>error</code>=command failed</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Note</p><p><code>success</code> is returned for HTTP status code <code>2xx</code>, else <code>error</code> is returned</p></div>             |

Example:

```cpp
{
  "proxy" : {
   "error_code" : 200,
   "error_reason" : "OK",
   "result" : "success"
  }
}
```

## Version History and Greenbox Migration <a href="#sec_prx_versions_greenbox" id="sec_prx_versions_greenbox"></a>

Versions < 3.0.7 are out-dated and cannot be used any longer, since Commerce Gateway (CG) has changed server certificates to new root CA "AddTrust External CA Root" (Sectigo Limited). Therefore, older Cloud Proxy version won't be able to connect if installed.

Basically, ADK Cloud Proxy is provided as two different version variants:

* Versions < 3.1.0 are used for older ADKs (ADK <4.9), which use Verifone Commerce Gateway (CG) endpoints with base URL `cgateway.verifone.com`
* Versions >= 3.1.0 are planned for ADKs >=4.9 intened for use of new GSC environments of **Verifone Greenbox**.

With update of Cloud Proxy to version >= 3.1.0, new GSC entpoints will automatically be applied with installation of the base package (see chapter [Cloud Proxy base packages](#subsec_prx_base_packages)). The configured environment endpoint (used by old Cloud Proxy < 3.1.0) is mapped to the corresponding new GSC endpoint, which will be used by the updated Cloud Proxy >= 3.1.0. The mapping of the environments during the update shows the follwing table:

|                                                 |                                             |
| ----------------------------------------------- | ------------------------------------------- |
| CG environment with old versions (< 3.1.0)      | GSC environment with new version (>= 3.1.0) |
| **`dev`** (dev.cgateway.verifone.com)           | **`gsc_dev`** (dev2.test-gsc.vfims.com)     |
| **`test`** (test.cgateway.verifone.com)         | **`gsc_qat`** (qat2.test-gsc.vfims.com)     |
| **`staging1`** (staging1.cgateway.verifone.com) | **`gsc_cst`** (cst2.test-gsc.vfims.com)     |
| **`prod`** (cgateway.verifone.com)              | **`gsc_prod`** (gsc.verifone.cloud)         |

Even version >= 3.1.0 might use old CG environment endpoints, if the corresponding activation package is installed. Finally, version 3.1.0 ADK Cloud Proxy has dropped support for Activation and Parameter Service, because the services were not used in past and no longer required. For this reason, customers must disable requests to the Activation and Parameter Service when using a newer Cloud Proxy in an older ADKs with Multi Application Controller (MAC) < 3.78.3. Otherwise it won't be possible to activate installed CPApps. For more details please refer to MAC documentation or documentation of old Cloud Proxy versions.

Since version 3.2.0 Cloud Proxy has added support to add environments with the installation of an User Configuration Package (see chapter [Install additional environments](#subsec_prx_install_additional_environments)).

Because customers weren't able to migrate their CPApps to new GSC endpoints within the envisaged timeframe, existing ADKs still have integrated an old version 3.0.x. Since 3.0.40 and 3.4.0 both version branches were synchronized and have a common code base, since features implemented for ADK 4.9 (e.g. GSC support) were also required for old ADKs. The only difference is version 3.4.0 will automatically switch to GSC endpoints with its installation, whereas version 3.0.40 will keep CG endpoints and must use activation packages to configure a GSC endpoint (see chapter [Default environments and activation](#subsec_prx_default_environments)). Thus, future ADKPRX releases will be provide in 2 variants supporting the same features. These variants use the following version schemes:

* `x.y.z` used for ADKs >= 4.9
* `x.0.yz` used for older ADKs < 4.9

With version 3.5.0 Cloud Proxy has added support for VOS3 platform. In addition, old CG endpoint were removed from the base package (see [Cloud Proxy base packages](#subsec_prx_base_packages)). Thus, old CG endpoints (`dev`, `test`, `staging1` and `prod`) are no longer available with default environments (see [Default environments and activation](#subsec_prx_default_environments) of version 3.5.0). Old ADKs for VOS/VOS2 from now must use version 3.0.50, if they still want to keep support for old endpoints, since version 3.5.0 as dropped it. Finally, documentation of version 3.0.50 declares CG endpoints as deprecated with recommendations to migrate to GSC. The last option to use old CG endpoints with version 3.5.0 is the installation of an User Configuration package on top of the base package. (see chapter [Install additional environments](#subsec_prx_install_additional_environments)). Customers are advised not to do this for new productive installations, since old CG environment endpoints will go offline sooner or later.

Since version 3.5.3 Cloud Proxy base package is provided as second variant for VOS and VOS2 platform. The reason is Cloud Proxy binary depends on OpenSSL, whereas older OS versions use OpenSSL 1.0.2, but since ADK 4.10 the OS will be upgraded to OpenSSL 3. Due to the fact different OpenSSL versions are used on these platforms for different ADKs, Cloud Proxy base package is provided as seperate variant `dl.cloudproxy-`**`ossl3`**`-X.X.X-X.tar` `dl.cloudproxy-`**`ossl3`**`-X.X.X-X-prod.tar`, which use name suffix **`-ossl3`**. The 2 variants will cover transition phase to new ADK 4.10 and the package w/o the suffix is kept as long as older ADKs with OpenSSL 1.0.2 must be supported.

For more version details please read release notes `prx-releasenotes-X.X.X-X.pdf` included in documentation package `prx-doc-X.X.X-X.zip`, which is provided with the ADK Cloud Proxy release.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/readme/system_overview/pg_all_components/pg_prx_users_guide.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
