Added default tcp web port (1028)
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>org.openautonomousconnection</groupId>
|
<groupId>org.openautonomousconnection</groupId>
|
||||||
<artifactId>Protocol</artifactId>
|
<artifactId>Protocol</artifactId>
|
||||||
<version>1.0.0-BETA.7.4</version>
|
<version>1.0.0-BETA.7.5</version>
|
||||||
<organization>
|
<organization>
|
||||||
<name>Open Autonomous Connection</name>
|
<name>Open Autonomous Connection</name>
|
||||||
<url>https://open-autonomous-connection.org/</url>
|
<url>https://open-autonomous-connection.org/</url>
|
||||||
|
|||||||
@@ -93,7 +93,10 @@ public final class CustomServerListener extends EventListener {
|
|||||||
if (q.getSub() == null && q.getTLN().equalsIgnoreCase("oac")) {
|
if (q.getSub() == null && q.getTLN().equalsIgnoreCase("oac")) {
|
||||||
if (q.getName().equalsIgnoreCase("info")) {
|
if (q.getName().equalsIgnoreCase("info")) {
|
||||||
// Return INS server info site
|
// Return INS server info site
|
||||||
String[] hostPort = insServer.getInsInfoSite().split(":");
|
String insInfo = insServer.getInsInfoSite();
|
||||||
|
if (!insInfo.contains(":")) insInfo = insInfo + ":1028";
|
||||||
|
|
||||||
|
String[] hostPort = insInfo.split(":");
|
||||||
resolved = List.of(new INSRecord(q.getType(), hostPort[0], -1, -1, Integer.parseInt(hostPort[1]), 0));
|
resolved = List.of(new INSRecord(q.getType(), hostPort[0], -1, -1, Integer.parseInt(hostPort[1]), 0));
|
||||||
} else if (q.getName().equalsIgnoreCase("register")) {
|
} else if (q.getName().equalsIgnoreCase("register")) {
|
||||||
// Return INS frontend site
|
// Return INS frontend site
|
||||||
@@ -108,6 +111,7 @@ public final class CustomServerListener extends EventListener {
|
|||||||
String resolve = insServer.resolveTLNInfoSite(q.getTLN());
|
String resolve = insServer.resolveTLNInfoSite(q.getTLN());
|
||||||
if (resolve == null) status = INSResponseStatus.INVALID_REQUEST;
|
if (resolve == null) status = INSResponseStatus.INVALID_REQUEST;
|
||||||
else {
|
else {
|
||||||
|
if (!resolve.contains(":")) resolve = resolve + ":1028";
|
||||||
String[] hostPort = resolve.split(":");
|
String[] hostPort = resolve.split(":");
|
||||||
resolved = List.of(new INSRecord(q.getType(), hostPort[0], -1, -1, Integer.parseInt(hostPort[1]), 0));
|
resolved = List.of(new INSRecord(q.getType(), hostPort[0], -1, -1, Integer.parseInt(hostPort[1]), 0));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ public final class AuthPacket extends OACPacket {
|
|||||||
|
|
||||||
if (fpFile.exists()) {
|
if (fpFile.exists()) {
|
||||||
String existing = FileUtils.readFileLines(fpFile).get(0);
|
String existing = FileUtils.readFileLines(fpFile).get(0);
|
||||||
|
if (!existing.equalsIgnoreCase(fp)) {
|
||||||
if (!protocolBridge.getProtocolClient().trustNewINSFingerprint(existing, fp)) {
|
if (!protocolBridge.getProtocolClient().trustNewINSFingerprint(existing, fp)) {
|
||||||
setResponseCode(INSResponseStatus.RESPONSE_AUTH_FAILED);
|
setResponseCode(INSResponseStatus.RESPONSE_AUTH_FAILED);
|
||||||
protocolBridge.getProtocolClient().getClientINSConnection().disconnect();
|
protocolBridge.getProtocolClient().getClientINSConnection().disconnect();
|
||||||
@@ -177,6 +178,7 @@ public final class AuthPacket extends OACPacket {
|
|||||||
FileUtils.writeFile(fpFile, fp + System.lineSeparator());
|
FileUtils.writeFile(fpFile, fp + System.lineSeparator());
|
||||||
allowWritePem = true;
|
allowWritePem = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!protocolBridge.getProtocolClient().trustINS(fp)) {
|
if (!protocolBridge.getProtocolClient().trustINS(fp)) {
|
||||||
setResponseCode(INSResponseStatus.RESPONSE_AUTH_FAILED);
|
setResponseCode(INSResponseStatus.RESPONSE_AUTH_FAILED);
|
||||||
|
|||||||
Reference in New Issue
Block a user