--- title: jdk.net.url.delayParsing Java System Property prop: jdk.net.url.delayParsing description: The jdk.net.url.delayParsing java system property can delay parsing of java.net.URL until after connection is opened. layout: layout date: Last Modified nav: system tags: networking since: Java 20 example_value: false ---
false - by default the property is not set and will not delay parsing until after the connection is opened
In versions prior to Java 20, the java.net.URL
constructor would not fully parse the URL until after the openConnection
or connect
method was called. In Java 20 and above the default is to perform the parsing first which may throw a MalformedURLException
upon an invalid URL value.
This system property was added to address backwards compatibility by setting it to true
, however this may lead to a less secure environment. The idea is that a threat actor could pass a URL which is invalid but may still open a connection to a host of their choosing.
Here are some other networking Java system properties:
http.agent
http.keepAlive
http.maxConnections
https.protocols
java.net.preferIPv4Stack
java.net.preferIPv6Addresses
java.net.useSystemProxies
javax.net.debug
javax.net.ssl.trustStore
jdk.net.hosts.file
jdk.tls.client.protocols
jdk.tls.disabledAlgorithms
networkaddress.cache.negative.ttl
networkaddress.cache.ttl
sun.net.client.defaultConnectTimeout
sun.net.client.defaultReadTimeout
sun.net.inetaddr.ttl