next proxy steps

This commit is contained in:
rusefi 2020-07-17 21:19:24 -04:00
parent f92ef7ae2d
commit 5caf428d2f
4 changed files with 41 additions and 3 deletions

View File

@ -1,6 +1,7 @@
<project default="jar">
<property name="jar_file_folder" value="../java_console_binary"/>
<property name="jar_file" value="${jar_file_folder}/rusefi_console.jar"/>
<property name="server_jar_file" value="${jar_file_folder}/rusefi_server.jar"/>
<property name="lib_list" value="../java_tools/configuration_definition/lib/snakeyaml.jar:lib/json-simple-1.1.1.jar:lib/server/javax.json.jar:lib/server/cactoos.jar:lib/server/takes.jar:lib/json-simple-1.1.1.jar:lib/jaxb-api.jar:lib/httpclient.jar:lib/httpmime.jar:lib/httpcore.jar:lib/jSerialComm.jar:lib/jcip-annotations-1.0.jar:lib/jlatexmath-1.0.6.jar:lib/swing-layout-1.0.jar:lib/jep.jar:lib/log4j.jar:lib/junit.jar:lib/SteelSeries-3.9.30.jar:lib/annotations.jar:lib/miglayout-4.0.jar:lib/surfaceplotter-2.0.1.jar"/>
<target name="clean">
@ -95,6 +96,18 @@
</target>
<target name="server_jar" depends="jar">
<delete file="${server_jar_file}"/>
<echo message="Building ${server_jar_file}"/>
<jar destfile="${server_jar_file}">
<zipfileset src="${jar_file}" includes="**/*.class"/>
<zipfileset src="lib/server/cactoos.jar" includes="**/*.class"/>
<zipfileset src="lib/server/javax.json.jar" includes="**/*.class"/>
<zipfileset src="lib/server/takes.jar" includes="**/*.class"/>
</jar>
</target>
<target name="jar" depends="compile, autoupdate_jar">
<mkdir dir="build/jar"/>
<delete file="${jar_file}"/>

View File

@ -0,0 +1,9 @@
Test certificate generated with the following command
``keytool -genkey -keyalg RSA -alias selfsigned -keystore test.jks -storepass password -validity 360 -keysize 2048``
Converted using
keytool -importkeystore -srckeystore keystore.jks -destkeystore keystore.jks -deststoretype pkcs12

Binary file not shown.

View File

@ -11,9 +11,12 @@ import com.rusefi.io.LinkManager;
import com.rusefi.io.commands.HelloCommand;
import com.rusefi.server.*;
import com.rusefi.tools.online.ProxyClient;
import org.junit.Before;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.CountDownLatch;
@ -29,12 +32,26 @@ import static org.junit.Assert.assertTrue;
/**
* integration test of the rusEFI online backend process
* At the moment this test is very loose with timing it must be unreliable?
*
* <p>
* https://github.com/rusefi/web_backend/blob/master/documentation/rusEFI%20remote.png
*/
public class ServerTest {
private final static Logger logger = Logger.CONSOLE;
@Before
public void setTestCertificate() throws MalformedURLException {
File certificate = new File("certificate/test.jks");
if (!certificate.exists())
throw new IllegalStateException("Certificate not found " + certificate);
String file = certificate.toURI().toURL().getFile();
String password = "password";
System.setProperty("javax.net.ssl.keyStore", file);
System.setProperty("javax.net.ssl.keyStorePassword", password);
System.setProperty("javax.net.ssl.trustStore", file);
System.setProperty("javax.net.ssl.trustStorePassword", password);
}
@Test
public void testControllerSessionTimeout() throws InterruptedException, IOException {
int serverPort = 7000;
@ -219,7 +236,6 @@ public class ServerTest {
assertEquals(Double.toString(value), clientValue);
backend.close();
clientManager.stop();
}
}