# HG changeset patch
# User Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
# Date 1706794325 -3600
# Node ID 68994abe3e03a6d2837636dab5a8cbbf99ccd536
# Parent  d74e850e2991c3a99a99f8c20765800c931e5c8b
Also catch java.net.URISyntaxException and java.net.MalformedURLException and convert them to an IOException.

diff --git a/tests/TLSTester.java b/tests/TLSTester.java
--- a/tests/TLSTester.java
+++ b/tests/TLSTester.java
@@ -128,7 +128,14 @@ public class TLSTester {
 	}
 
 	private InputStream fetchData(String resource) throws IOException {
-		URL url = new java.net.URI("http://" + serverHost + ":" + serverPort + resource).toURL;
+		URL url;
+		try {
+			// Note: as of Java version 20 java.net.URL(String) constructor is deprecated.
+			// https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/net/URL.html#%3Cinit%3E(java.lang.String)
+			url = new java.net.URI("http://" + serverHost + ":" + serverPort + resource).toURL();
+		} catch (java.net.URISyntaxException | java.net.MalformedURLException e) {
+			throw new IOException(e.getMessage());
+		}
 		URLConnection conn = url.openConnection();
 		conn.connect();
 		return conn.getInputStream();