Skip to content

Commit

Permalink
Remove enforcement on internal webserver,g fix .equals
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Matsuoka authored and andrewazores committed Dec 19, 2024
1 parent bbc6c9b commit 263a21e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/io/cryostat/agent/MainModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public static SSLContext provideClientSslContext(
try {
KeyManager[] keyManagers = null;
if (clientAuthCertPath.isPresent() && clientAuthKeyPath.isPresent() && tlsEnabled) {
if (!baseUri.getScheme().contains("https")) {
if (!baseUri.getScheme().equals("https")) {
throw new IllegalArgumentException(
String.format(
"If TLS is enabled via the (%s) property, the base URI (%s)"
Expand Down Expand Up @@ -698,11 +698,10 @@ public static HttpServer provideHttpServer(
ScheduledExecutorService executor,
@Named(ConfigModule.CRYOSTAT_AGENT_WEBSERVER_HOST) String host,
@Named(ConfigModule.CRYOSTAT_AGENT_WEBSERVER_PORT) int port,
@Named(HTTP_SERVER_SSL_CTX) Optional<SSLContext> sslContext,
@Named(ConfigModule.CRYOSTAT_AGENT_TLS_ENABLED) boolean tlsEnabled) {
@Named(HTTP_SERVER_SSL_CTX) Optional<SSLContext> sslContext) {
try {
HttpServer http;
if (sslContext.isEmpty() || !tlsEnabled) {
if (sslContext.isEmpty()) {
http = HttpServer.create(new InetSocketAddress(host, port), 0);
} else {
http = HttpsServer.create(new InetSocketAddress(host, port), 0);
Expand Down

0 comments on commit 263a21e

Please sign in to comment.