I am getting the below error when I tried to use HTTPS in spring native application.
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.
HTTPS URL protocol was not enabled. Please help me to enable during the build.
Update
Found the solution, looking on spring native documentation. https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#native-image-options
Add the below code to pom.xml under the plugin section
<BP_NATIVE_IMAGE_BUILD_ARGUMENTS>--enable-https</BP_NATIVE_IMAGE_BUILD_ARGUMENTS>
Updated pom.xml looks like this.
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<builder>paketobuildpacks/builder:tiny</builder>
<env>
<BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>
<BP_NATIVE_IMAGE_BUILD_ARGUMENTS>--enable-https</BP_NATIVE_IMAGE_BUILD_ARGUMENTS>
</env>
</image>
</configuration>
</plugin>