The rest-template smoke tests currently fails with:

Caused by: java.net.MalformedURLException: Accessing an URL protocol that was not enabled. The URL protocol http is supported but not enabled by default. It must be enabled by adding the --enable-url-protocols=http option to the native-image command.
    at com.oracle.svm.core.jdk.JavaNetSubstitutions.unsupported(JavaNetSubstitutions.java:257)
    at com.oracle.svm.core.jdk.JavaNetSubstitutions.getURLStreamHandler(JavaNetSubstitutions.java:231)
    at java.net.URL.getURLStreamHandler(URL.java:79)
    at java.net.URL.<init>(URL.java:680)
    at java.net.URL.fromURI(URL.java:748)
    at java.net.URI.toURL(URI.java:1139)
    at org.springframework.http.client.SimpleClientHttpRequestFactory.createRequest(SimpleClientHttpRequestFactory.java:130)
    at org.springframework.http.client.support.HttpAccessor.createRequest(HttpAccessor.java:124)
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:773)
    ... 8 more

and

Caused by: java.net.MalformedURLException: Accessing an URL protocol that was not enabled. The URL protocol https is supported but not enabled by default. It must be enabled by adding the --enable-url-protocols=https option to the native-image command.
    at com.oracle.svm.core.jdk.JavaNetSubstitutions.unsupported(JavaNetSubstitutions.java:257)
    at com.oracle.svm.core.jdk.JavaNetSubstitutions.getURLStreamHandler(JavaNetSubstitutions.java:231)
    at java.net.URL.getURLStreamHandler(URL.java:79)
    at java.net.URL.<init>(URL.java:680)
    at java.net.URL.fromURI(URL.java:748)
    at java.net.URI.toURL(URI.java:1139)
    at org.springframework.http.client.SimpleClientHttpRequestFactory.createRequest(SimpleClientHttpRequestFactory.java:130)
    at org.springframework.http.client.support.HttpAccessor.createRequest(HttpAccessor.java:124)
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:773)
    ... 8 more

We should enable http and https protocol. We could make that conditional, for example only if webmvc or webflux is on the classpath. Or we could just enable it unconditionally.

The AOT smoke test binary for rest-template is 60.966.448 bytes in size (on my machine) without http or https support. Enabling http grows it to 62.473.776 bytes, enabling https on top of http grows it to 62.539.312 bytes.

Comment From: mhalbritter

@sdeleuze @snicoll what's your opinion on this?

Comment From: sdeleuze

Let's discuss next week if we introduce an API (in RuntimeHints?) to configure various native-image parameters or not. Could be useful for end users but also for portfolio projets.

Comment From: sdeleuze

I created related spring-projects/spring-framework#29090 issue scheduled for Spring Framework 6 RC1.

Comment From: wilkinsona

Closing in favor of the Framework issue

Comment From: sdeleuze

Fix by spring-projects/spring-framework#29185.