Add auth request handling
This commit is contained in:
@@ -9,6 +9,7 @@ import javax.net.ssl.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import static common.common.src.ports.Ports.ACS_SERVER_PORT;
|
||||
import static common.common.src.ports.Ports.PORT_AUTH;
|
||||
|
||||
|
||||
public class Main {
|
||||
@@ -30,7 +31,10 @@ public class Main {
|
||||
ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
|
||||
|
||||
Thread serverThread = SSLServerFactory.createServer(ctx, ACS_SERVER_PORT, Main::handleRequest);
|
||||
Thread authThread = SSLServerFactory.createServer(ctx, PORT_AUTH, Main::handleAuth);
|
||||
|
||||
serverThread.start();
|
||||
authThread.start();
|
||||
}
|
||||
|
||||
private static void handleRequest(SSLSocket clientSocket) {
|
||||
@@ -47,4 +51,14 @@ public class Main {
|
||||
}
|
||||
}
|
||||
|
||||
private static void handleAuth(SSLSocket clientSocket) {
|
||||
try{
|
||||
String response = SocketManager.readResponse(clientSocket);
|
||||
Logger.displayReceived(response);
|
||||
SocketManager.send(clientSocket, "token");
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user