From 890a9863ad40066874c7fbc006f51ec2de31d7d6 Mon Sep 17 00:00:00 2001 From: Jordi Deu-Pons Date: Mon, 13 Dec 2021 13:35:49 +0100 Subject: [PATCH] Do not allow to use non-SSL connections in any way. Resolves #25 --- src/main/java/io/seqera/tower/agent/Agent.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/main/java/io/seqera/tower/agent/Agent.java b/src/main/java/io/seqera/tower/agent/Agent.java index ef55a59..b97fa60 100644 --- a/src/main/java/io/seqera/tower/agent/Agent.java +++ b/src/main/java/io/seqera/tower/agent/Agent.java @@ -72,9 +72,6 @@ public class Agent implements Runnable { @Option(names = {"-u", "--url"}, description = "Tower server API endpoint URL. Defaults to tower.nf (TOWER_API_ENDPOINT)", defaultValue = "${TOWER_API_ENDPOINT:-https://api.tower.nf}", required = true) String url; - @Option(names = {"--no-secure"}, description = "Explicitly allow to connect to a non-SSL secured Tower server (this is not recommended)") - boolean noSecure; - private ApplicationContext ctx; private AgentClientSocket agentClient; @@ -104,14 +101,10 @@ public void run() { private void connectTower() { try { final URI uri = new URI(url + "/agent/" + agentKey + "/connect"); - if (!uri.getScheme().equals("https") && !noSecure) { + if (!uri.getScheme().equals("https")) { logger.error("You are trying to connect to an insecure server: {}", url); - logger.error("if you want to force the connection use '--no-secure' option. NOT RECOMMENDED!"); System.exit(-1); } - if (!uri.getScheme().equals("https") && noSecure) { - logger.warn("You are connecting using an INSECURE CONNECTION: {}", url); - } final MutableHttpRequest req = HttpRequest.GET(uri).bearerAuth(token); final RxWebSocketClient webSocketClient = ctx.getBean(RxWebSocketClient.class);