Skip to content

Tag: https

How to convert https url to File in Java?

I have an https url which is of String format. How can I convert it to File? I tried this but I’m getting error – URI scheme is not “file” Answer FileUtils.copyURLToFile worked well for me. Reference –

Quotation marks in Camel Content-Type header

I am trying to invoke a SOAP service using camel-http4. This service requires me to send the following header: Content-Type: application/soap+xml;charset=UTF-8;action=”ListBerichten”. I have to include the quotation marks, or otherwise the service will return a 400 code When I try this with a client like Postman or SoapUI or curl it works fine, but when I try it with Camel,

Including a .pem certificate in a Java HTTP request

I am currently able to access a web service that requires a client certificate using the following curl command: curl -k -v –cert ./certificate.pem How do I make this request in a Java application? Notice that I need the -k flag which allows curl to make “insecure” SSL connections. This needs to be done in the Java application as