Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
New Contributor

SSL VPN connection to a Fortinet firewall with Java

I'm trying to create an SSL VPN connection to a Fortinet firewall with Java.

To build up a socket connection in Java is not a problem, but how do I authenticate to the firewall and create the VPN tunnel? Unfortunately, I haven't found any tutorials. Maybe someone can help me with that.

public static void main(String[] args) throws IOException {
String vpnHost = "fortigateVPNHost";
int vpnPort = 443;
String vpnUser = "vpnUser";
String vpnPassword = "vpnPassword";

SSLSocketFactory sslsocketfactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
SSLSocket sslsocket = (SSLSocket) sslsocketfactory.createSocket(vpnHost, vpnPort);

InputStream in = sslsocket.getInputStream();
OutputStream out = sslsocket.getOutputStream();
while (in.available() > 0) {
System.out.println("Secured connection performed successfully");

New Contributor

Based on the TIOBE Index for June 2016 Java is now more well-known than a variety of widely-used programming languages, including C++, Python, C#, PHP and JavaScript. The statistics on usage posted on various websites illustrate the immense popularity and importance of Java in the present day world. Java is an all-purpose programming language. Certain developers prefer to use Java to build desktop GUI applications as well as other developers create numerous web-based applications using Java technologies. In addition, Java is also used extensively for the development of mobile applications and games for Android which is the mobile platform with the biggest user base. There are plenty of reasons that Java is going to be a major factor over an extended period of time.

Visit: Java Course in Pune


Select Forum Responses to become Knowledge Articles!

Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.

Top Kudoed Authors