Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
varsha
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.print(in.read());
}
System.out.println("Secured connection performed successfully");
}

1 REPLY 1
Prutuja
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

Labels
Top Kudoed Authors