Description |
This article provides a comprehensive guide to resolving conflicts between IPV4 and IPV6 usage when connecting to a Zero Trust Network Access (ZTNA) access proxy destination, particularly for PostgreSQL environments with Java dependencies.
Users encountering the '[fortitcs error] CopyNetBuffer error' in the FortiClient diagnostic logs may be experiencing connectivity issues stemming from the software's reliance on IPV6 addresses instead of IPV4. |
Scope | EMS, FortiClient, ZTNA Access proxy, Fortigate, Java. |
Solution |
This article walks through the process of configuring a Zero Trust Network Access (ZTNA) Access Proxy for connecting to PostgreSQL on a FortiGate device. Specifically, it explores a sample configuration where the PostgreSQL connection utilizes port 5432 by default, but the Access Proxy rule is set for a different port, 5435.
Whether using DBeaver or SQuirreL SQL Client applications, this guide ensures a smooth and secure PostgreSQL connection through the Access Proxy.
Access Proxy Configuration:
Conclusion: By following these steps, it is possible to configure a ZTNA Access Proxy on the FortiGate device for PostgreSQL connections, even when using non-default ports.
This configuration ensures secure and efficient communication between the PostgreSQL client applications like DBeaver or SQuirreL SQL Client and the PostgreSQL server through the specified Access Proxy rules. Regularly review and adapt these configurations to meet the evolving needs of the network environment.
Forticlient EMS Configuration: Those two applications are based on Java programming language and in the background they need Java dependencies to connect to PostgreSQL. To collect ZTNA-related logs from the endpoint side.
As a regular troubleshooting step when checking fortitcs.log under diagnostic logs FCDiagData\general\logs\trace, probably the following error messages will appear: [fortitcs error] CopyNetBuffer error:
That is because the software still uses IPV6 addresses instead of IPV4. In the Windows OS java environmental variables should force to use ipv4 instead of ipv6 to establish the connection. In order to check existing configurations for Java environmental variables.
echo %_JAVA_OPTIONS%
To adjust environmental variables to connect via IPV4.
setx _JAVA_OPTIONS -Djava.net.preferIPv4Stack=true |