Fix comment
This commit is contained in:
@@ -1,18 +1,19 @@
|
|||||||
package acq.acq.src;
|
package acq.acq.src;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import javax.net.ssl.KeyManagerFactory;
|
||||||
|
import javax.net.ssl.SSLContext;
|
||||||
|
import javax.net.ssl.SSLSocket;
|
||||||
|
import javax.net.ssl.SSLSocketFactory;
|
||||||
|
import javax.net.ssl.TrustManagerFactory;
|
||||||
|
|
||||||
import common.common.src.crypto.KeyFactory;
|
import common.common.src.crypto.KeyFactory;
|
||||||
import common.common.src.logger.Logger;
|
import common.common.src.logger.Logger;
|
||||||
|
import static common.common.src.ports.Ports.ACQ_SERVER_PORT;
|
||||||
|
import static common.common.src.ports.Ports.ACS_SERVER_PORT;
|
||||||
import common.common.src.requestHandlers.SSLServerFactory;
|
import common.common.src.requestHandlers.SSLServerFactory;
|
||||||
import common.common.src.socket.SocketManager;
|
import common.common.src.socket.SocketManager;
|
||||||
|
|
||||||
import javax.net.ssl.*;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
|
|
||||||
import static common.common.src.ports.Ports.*;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
private static final String HOST = "127.0.0.1";
|
private static final String HOST = "127.0.0.1";
|
||||||
@@ -35,9 +36,6 @@ public class Main {
|
|||||||
ctx = SSLContext.getInstance("TLS");
|
ctx = SSLContext.getInstance("TLS");
|
||||||
ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
|
ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
|
||||||
|
|
||||||
//requestACS(ctx, ACS_SERVER_PORT);
|
|
||||||
//requestACS(ctx, AUTH_PORT);
|
|
||||||
|
|
||||||
Thread ACQServer = SSLServerFactory.createServer(ctx, ACQ_SERVER_PORT, Main::handleRequest);
|
Thread ACQServer = SSLServerFactory.createServer(ctx, ACQ_SERVER_PORT, Main::handleRequest);
|
||||||
ACQServer.start();
|
ACQServer.start();
|
||||||
|
|
||||||
@@ -49,8 +47,7 @@ public class Main {
|
|||||||
Logger.displayReceived(response);
|
Logger.displayReceived(response);
|
||||||
|
|
||||||
|
|
||||||
// contact ACS
|
// Setup Connection ACS
|
||||||
|
|
||||||
SSLSocketFactory factory = ctx.getSocketFactory();
|
SSLSocketFactory factory = ctx.getSocketFactory();
|
||||||
SSLSocket socketACS = (SSLSocket) factory.createSocket(Main.HOST, ACS_SERVER_PORT);
|
SSLSocket socketACS = (SSLSocket) factory.createSocket(Main.HOST, ACS_SERVER_PORT);
|
||||||
socketACS.startHandshake();
|
socketACS.startHandshake();
|
||||||
@@ -60,11 +57,12 @@ public class Main {
|
|||||||
SocketManager.send(socketACS, request);
|
SocketManager.send(socketACS, request);
|
||||||
Logger.displaySent(request);
|
Logger.displaySent(request);
|
||||||
|
|
||||||
|
// Wait for ACK or NAK
|
||||||
|
|
||||||
response = SocketManager.readResponse(socketACS);
|
response = SocketManager.readResponse(socketACS);
|
||||||
Logger.displayReceived(response);
|
Logger.displayReceived(response);
|
||||||
|
|
||||||
// Send back ACK or NAK
|
// Send back ACK or NAk To https server
|
||||||
|
|
||||||
SocketManager.send(serverSocket, response);
|
SocketManager.send(serverSocket, response);
|
||||||
|
|
||||||
}catch (IOException ioe){
|
}catch (IOException ioe){
|
||||||
|
|||||||
Reference in New Issue
Block a user